diff --git a/common/content/ui.js b/common/content/ui.js index ac926018..42245d6b 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -493,13 +493,17 @@ function CommandLine() //{{{ }); var autocompleteTimer = new Timer(200, 500, function autocompleteTell(tabPressed) { - if (events.feedingKeys || !completions) - return; - - completions.complete(true, false); - completions.itemList.show(); + if (!events.feedingKeys && completions) + { + completions.complete(true, false); + completions.itemList.show(); + } }); + // This timer just prevents s from queueing up when the + // system is under load (and, thus, giving us several minutes of + // the completion list scrolling). Multiple presses are + // still processed normally, as the time is flushed on "keyup". var tabTimer = new Timer(0, 0, function tabTell(event) { if (completions) completions.tab(event.shiftKey); @@ -870,7 +874,7 @@ function CommandLine() //{{{ var myModes = [modes.COMMAND_LINE]; - // TODO: move "", "", "" here from mappings mappings.add(myModes, [""], "Focus content", function () { events.onEscape(); }); @@ -963,14 +967,14 @@ function CommandLine() //{{{ return { - HL_NORMAL : "Normal", - HL_ERRORMSG : "ErrorMsg", - HL_MODEMSG : "ModeMsg", - HL_MOREMSG : "MoreMsg", - HL_QUESTION : "Question", - HL_INFOMSG : "InfoMsg", - HL_WARNINGMSG : "WarningMsg", - HL_LINENR : "LineNr", + HL_NORMAL: "Normal", + HL_ERRORMSG: "ErrorMsg", + HL_MODEMSG: "ModeMsg", + HL_MOREMSG: "MoreMsg", + HL_QUESTION: "Question", + HL_INFOMSG: "InfoMsg", + HL_WARNINGMSG: "WarningMsg", + HL_LINENR: "LineNr", FORCE_MULTILINE : 1 << 0, FORCE_SINGLELINE : 1 << 1, @@ -1010,6 +1014,8 @@ function CommandLine() //{{{ { try { + // The long path is because of complications with the + // completion preview. return commandWidget.inputField.editor.rootElement.firstChild.textContent; } catch (e) {} @@ -1068,7 +1074,7 @@ function CommandLine() //{{{ if (history) history.save(); - this.resetCompletions(); // cancels any asynchronous completion still going on, must be before completions = null + this.resetCompletions(); // cancels any asynchronous completion still going on, must be before we set completions = null completions = null; history = null; @@ -1124,7 +1130,7 @@ function CommandLine() //{{{ */ echo: function echo(str, highlightGroup, flags) { - // liberator.echo uses different order of flags as it omits the highlight group, change v.commandline.echo argument order? --mst + // liberator.echo uses different order of flags as it omits the highlight group, change commandline.echo argument order? --mst if (silent) return false; @@ -1374,11 +1380,10 @@ function CommandLine() //{{{ * these come from liberator when modes.extended & modes.MULTILINE_OUTPUT * and also from #liberator-multiline-output in the XUL * - * FIXME: if 'more' is set and the MOW is not scrollable we should still - * allow a down motion after an up rather than closing - * * @param {Event} event */ + // FIXME: if 'more' is set and the MOW is not scrollable we should still + // allow a down motion after an up rather than closing onMultilineOutputEvent: function onMultilineOutputEvent(event) { let win = multilineOutputWidget.contentWindow; @@ -1589,13 +1594,13 @@ function CommandLine() //{{{ }, /** - * Refresh or remove the prompt that displays when in multiline mode. - * showHelp will cause the possible key-options to be displayed, - * force will cause a display of the default message even if it - * could be at the end of the output. + * Update or remove the multiline output widget's "MORE" + * prompt. * - * @param {boolean} force - * @param {boolean} showHelp + * @param {boolean} force If true, "-- More --" is shown + * even if we're at the end of the output. + * @param {boolean} showHelp When true, show the valid key + * sequences and what they do. */ updateMorePrompt: function updateMorePrompt(force, showHelp) { @@ -1615,12 +1620,11 @@ function CommandLine() //{{{ }, /** - * Changes the height of the multilineOutputWidget to fit - * its contents, if open is true, it will cause the - * widget to uncollapse, if not it will leave the widget - * closed. + * Changes the height of the multilineOutputWidget to fit in + * the available space. * - * @param {boolean} open + * @param {boolean} open If true, the widget will be opened if + * it's not already so. */ updateOutputHeight: function updateOutputHeight(open) { @@ -1644,13 +1648,8 @@ function CommandLine() //{{{ outputContainer.collapsed = false; }, - /** - * Disable any active completion functions by calling their cancelFunc's - * Will also remove the completions preview window. - */ resetCompletions: function resetCompletions() { - // liberator.dump("Resetting completions..."); if (completions) { completions.context.cancelAll(); @@ -1665,11 +1664,12 @@ function CommandLine() //{{{ }; //}}} /** - * The list which is used for the completion box (and QuickFix window in future) + * The list which is used for the completion box (and QuickFix window + * in future). * - * @param {string} id The id of the XUL