diff --git a/common/content/commandline.js b/common/content/commandline.js index d7a1dee1..1ed66749 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -290,9 +290,8 @@ var CommandWidgets = Class("CommandWidgets", { }), multilineOutput: Class.Memoize(function () this._whenReady("dactyl-multiline-output", function (elem) { - elem.contentWindow.addEventListener("unload", function (event) { event.preventDefault(); }, true); - elem.contentDocument.documentElement.id = "dactyl-multiline-output-top"; - elem.contentDocument.body.id = "dactyl-multiline-output-content"; + elem.contentWindow.addEventListener("beforeunload", function (event) { event.preventDefault(); }, true); + highlight.highlightNode(elem.contentDocument.body, "MOW"); }), true), multilineInput: Class.Memoize(function () document.getElementById("dactyl-multiline-input")), @@ -609,6 +608,8 @@ var CommandLine = Module("commandline", { util.waitFor(bind(this.widgets._ready, null, elem)); node.completionList = ItemList(elem); + node.completionList.isAboveMow = node.id == + this.widgets.statusbar.commandline.id } return node.completionList; }, @@ -1912,8 +1913,11 @@ var ItemList = Class("ItemList", { root.style.minWidth = document.getElementById("dactyl-commandline").scrollWidth + "px"; let { minHeight } = this; - this.minHeight = Math.max(this.minHeight, - this.win.scrollY + DOM(completions).rect.bottom); + if (mow.visible && this.isAboveMow) // Kludge. + minHeight -= mow.wantedHeight; + + let needed = this.win.scrollY + DOM(completions).rect.bottom; + this.minHeight = Math.max(minHeight, needed); if (!this.visible) root.style.minWidth = ""; @@ -2090,7 +2094,8 @@ var ItemList = Class("ItemList", { ? this.maxItems / 2 : 0); } - let range = ItemList.Range(Math.max(0, start - start % 2), Math.min(this.itemCount, end)); + let range = ItemList.Range(Math.max(0, start - start % 2), + Math.min(this.itemCount, end)); let first; for (let [i, row] in this.context.getRows(this.generatedRange.start, diff --git a/common/content/mappings.js b/common/content/mappings.js index 0b8ec7c7..bc253656 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -128,13 +128,10 @@ var Map = Class("Map", { if (this.names[0] != ".") // FIXME: Kludge. mappings.repeat = repeat; - if (this.executing) { - if (args.keypressEvents[0].isMacro) { - util.dumpStack(_("map.recursive", args.command)); - throw FailedAssertion(_("map.recursive", args.command)); - } - this.executing = false; - } + if (this.executing) + util.assert(!args.keypressEvents[0].isMacro, + _("map.recursive", args.command), + false); try { this.preExecute(args); diff --git a/common/content/mow.js b/common/content/mow.js index fadd4eb1..799d2fb6 100644 --- a/common/content/mow.js +++ b/common/content/mow.js @@ -252,10 +252,13 @@ var MOW = Module("mow", { doc.body.style.minWidth = this.widgets.commandbar.commandline.scrollWidth + "px"; - this.widgets.mowContainer.height = Math.min(doc.body.clientHeight, availableHeight) + "px"; - this.timeout(function () - this.widgets.mowContainer.height = Math.min(doc.body.clientHeight, availableHeight) + "px", - 0); + function adjust() { + let wantedHeight = doc.body.clientHeight; + this.widgets.mowContainer.height = Math.min(wantedHeight, availableHeight) + "px", + this.wantedHeight = Math.max(0, wantedHeight - availableHeight); + } + adjust.call(this); + this.timeout(adjust); doc.body.style.minWidth = ""; diff --git a/common/modules/highlight.jsm b/common/modules/highlight.jsm index a603906e..fbfa87f9 100644 --- a/common/modules/highlight.jsm +++ b/common/modules/highlight.jsm @@ -348,7 +348,7 @@ var Highlights = Module("Highlight", { "text-align: center"], ([h.class, XXX, - template.map(h.extends, function (s) template.highlight(s)), + template.map(h.extends, function (s) template.highlight(s), <>,), template.highlightRegexp(h.value, /\b[-\w]+(?=:)|\/\*.*?\*\//g, function (match) {match}) ] diff --git a/common/skin/dactyl.css b/common/skin/dactyl.css index f8726865..53d3dc29 100644 --- a/common/skin/dactyl.css +++ b/common/skin/dactyl.css @@ -200,27 +200,6 @@ statusbarpanel { font: inherit; } -.dactyl-completions-content, -#dactyl-multiline-output-content, -#dactyl-multiline-input { - white-space: pre; - font-family: -moz-fixed; - margin: 0px; -} - -.dactyl-completions-content table, -#dactyl-multiline-output-content table { - white-space: inherit; - border-spacing: 0px; -} - -.dactyl-completions-content td, -#dactyl-multiline-output-content td, -.dactyl-completions-content th, -#dactyl-multiline-output-content th { - padding: 0px 2px; -} - /* for Teledactyl's composer */ #content-frame, #appcontent { border: 0px; diff --git a/common/skin/global-styles.css b/common/skin/global-styles.css index 5f175649..72318dab 100644 --- a/common/skin/global-styles.css +++ b/common/skin/global-styles.css @@ -84,6 +84,12 @@ CmdInput;.dactyl-commandline-command CmdOutput /* The output of commands executed by :run */ \ white-space: pre; +MOW;;;FontFixed,Normal /* The Multiline Output Window */ \ + margin: 0; white-space: pre; + +MOW table white-space: inherit; border-spacing: 0px; +MOW :-moz-any(td, th) padding: 0px 2px; + Comp;;;FontFixed,Normal /* The completion window */ \ margin: 0; border-top: 1px solid black;