diff --git a/content/completion.js b/content/completion.js index af1a4aeb..57161d5d 100644 --- a/content/completion.js +++ b/content/completion.js @@ -194,7 +194,6 @@ CompletionContext.prototype = { let lock = {}; this.cache.backgroundLock = lock; this.incomplete = true; - liberator.dump({name: this.name, length: this.items.length}); let now = Date.now(); liberator.callAsync(this, function () { let items = this.generate(); @@ -253,9 +252,7 @@ CompletionContext.prototype = { if (quote) filtered.forEach(function (item) { item.unquoted = item.text; - try { item.text = quote[0] + quote[1](item.text) + quote[2]; - } catch(e) { liberator.dump(quote.map(function (x) <>{util.objectToString(x)})) } }) if (options.get("wildoptions").has("sort")) filtered.sort(this.compare); diff --git a/content/style.js b/content/style.js index c0d851a1..39825e3d 100644 --- a/content/style.js +++ b/content/style.js @@ -24,7 +24,7 @@ function Highlights(name, store, serial) WarningMsg color: red; background: white; Message white-space: normal; min-width: 100%; padding-left: 2em; text-indent: -2em; display: block; NonText color: blue; min-height: 16px; padding-left: 2px; - + Preview color: gray; CompTitle color: magenta; background: white; font-weight: bold; CompTitle>* border-bottom: 1px dashed magenta; diff --git a/content/ui.js b/content/ui.js index f002bf0f..0b0d0d18 100644 --- a/content/ui.js +++ b/content/ui.js @@ -65,7 +65,6 @@ function CommandLine() //{{{ var historyIndex = UNINITIALIZED; var historyStart = ""; - var removeSuffix = ""; var messageHistory = { _messages: [], @@ -322,10 +321,11 @@ function CommandLine() //{{{ let wildType = wildmode.values[Math.min(wildIndex, wildmode.values.length - 1)]; if (wildmode.checkHas(wildType, "longest")) { + // highlight= won't work here. let start = commandWidget.selectionStart; let substring = completionContext.longestAllSubstring.substr(start - completionContext.allItems.start); - removeSuffix = substring; - editor.insertNode(util.xmlToDom({substring}, document), editor.rootElement, 1); + let node = {substring} + editor.insertNode(util.xmlToDom(node, document), editor.rootElement, 1); commandWidget.selectionStart = commandWidget.selectionEnd = start; } } @@ -686,7 +686,7 @@ function CommandLine() //{{{ getCommand: function getCommand() { - return commandWidget.value; + return commandWidget.inputField.editor.rootElement.firstChild.textContent; }, open: function open(prompt, cmd, extendedMode) @@ -1276,8 +1276,6 @@ function CommandLine() //{{{ previewSubstring(); let command = this.getCommand(); - if (command.substr(command.length - removeSuffix.length) == removeSuffix) - command = command.substr(0, command.length - removeSuffix.length) completionPrefix = command.substring(0, commandWidget.selectionStart); completionPostfix = command.substring(commandWidget.selectionStart); },