diff --git a/content/io.js b/content/io.js index a166c178..a5fcfb6c 100644 --- a/content/io.js +++ b/content/io.js @@ -776,7 +776,7 @@ lookup: // no need (actually forbidden) to add: js <{substring}, document), editor.rootElement, 1); + commandWidget.selectionStart = commandWidget.selectionEnd = start; + } + } + // sets the command - e.g. 'tabopen', 'open http://example.com/' function setCommand(cmd) { @@ -827,17 +851,7 @@ function CommandLine() //{{{ else if (event.type == "input") { liberator.triggerCallback("change", currentExtendedMode, command); - // Kludge. Major kludge. - let wildmode = options.get("wildmode"); - let wildType = wildmode.values[Math.min(wildIndex, wildmode.values.length - 1)]; - if (wildmode.checkHas(wildType, "longest")) - { - let start = commandWidget.selectionStart; - let substring = completionContext.longestAllSubstring.substr(start - completionContext.allItems.start); - removeSuffix = substring; - editor.insertNode(util.xmlToDom({substring}, document), editor.rootElement, 1); - commandWidget.selectionStart = commandWidget.selectionEnd = start; - } + previewSubstring(); } else if (event.type == "keypress") { @@ -1260,6 +1274,7 @@ function CommandLine() //{{{ // prefix when wrapping around searches // with that, we SOMETIMES have problems with followed by in :open completions + previewSubstring(); let command = this.getCommand(); if (command.substr(command.length - removeSuffix.length) == removeSuffix) command = command.substr(0, command.length - removeSuffix.length)