]> git.donarmstrong.com Git - dactyl.git/blobdiff - common/content/commandline.js
Import 1.0 supporting Firefox up to 14.*
[dactyl.git] / common / content / commandline.js
index 895ae4db847ac04ebc4fface42c38b8e6c44209d..c318759626db4b8df5accd6c6466c13b0ee1abdf 100644 (file)
@@ -282,9 +282,12 @@ var CommandWidgets = Class("CommandWidgets", {
     contextMenu: Class.Memoize(function () {
         ["copy", "copylink", "selectall"].forEach(function (tail) {
             // some host apps use "hostPrefixContext-copy" ids
-            let xpath = "//xul:menuitem[contains(@id, '" + "ontext-" + tail + "') and not(starts-with(@id, 'dactyl-'))]";
-            document.getElementById("dactyl-context-" + tail).style.listStyleImage =
-                DOM(DOM.XPath(xpath, document).snapshotItem(0)).style.listStyleImage;
+            let css   = "menuitem[id$='ontext-" + tail + "']:not([id^=dactyl-])";
+            let style = DOM(css, document).style;
+            DOM("#dactyl-context-" + tail, document).css({
+                listStyleImage: style.listStyleImage,
+                MozImageRegion: style.MozImageRegion
+            });
         });
         return document.getElementById("dactyl-contextmenu");
     }),
@@ -753,9 +756,7 @@ var CommandLine = Module("commandline", {
             data = message.message;
         }
 
-        if ((flags & this.ACTIVE_WINDOW) &&
-            window != services.windowWatcher.activeWindow &&
-            services.windowWatcher.activeWindow.dactyl)
+        if ((flags & this.ACTIVE_WINDOW) && window != overlay.activeWindow)
             return;
 
         if ((flags & this.DISALLOW_MULTILINE) && !this.widgets.mowContainer.collapsed)
@@ -1217,6 +1218,7 @@ var CommandLine = Module("commandline", {
         complete: function complete(show, tabPressed) {
             this.session.ignoredCount = 0;
 
+            this.waiting = null;
             this.context.reset();
             this.context.tabPressed = tabPressed;
 
@@ -1487,8 +1489,12 @@ var CommandLine = Module("commandline", {
                 this.wildIndex = this.wildtypes.length - 1;
 
             if (idx && idx[1] >= idx[0].items.length) {
-                this.waiting = idx;
-                statusline.progress = _("completion.waitingForResults");
+                if (!idx[0].incomplete)
+                    this.waiting = null;
+                else {
+                    this.waiting = idx;
+                    statusline.progress = _("completion.waitingForResults");
+                }
                 return;
             }
 
@@ -1669,6 +1675,7 @@ var CommandLine = Module("commandline", {
         });
 
         modes.addMode("INPUT_MULTILINE", {
+            description: "Active when the command line's multiline input buffer is open",
             bases: [modes.INSERT]
         });
     },
@@ -1945,6 +1952,7 @@ var ItemList = Class("ItemList", {
             // Check if we've passed any incomplete contexts
 
             let i = groups.indexOf(group);
+            util.assert(i >= 0, undefined, false);
             for (; i < groups.length; i++) {
                 let end = groups[i].offsets.start + groups[i].itemCount;
                 if (start >= end && groups[i].context.incomplete)