1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-19 22:17:59 +01:00

Fix incorrect completion operation when the caret moves.

This commit is contained in:
Kris Maglione
2010-09-23 21:49:54 -04:00
parent 2fd301c81a
commit 82dc6f3a91
2 changed files with 5 additions and 2 deletions

View File

@@ -1148,6 +1148,7 @@ const CommandLine = Module("commandline", {
// Reset the caret to one position after the completion.
this.caret = this.prefix.length + completion.length;
this._caret = this.caret;
},
get caret() this.editor.selection.focusOffset,
@@ -1333,6 +1334,10 @@ const CommandLine = Module("commandline", {
tab: function tab(reverse, wildmode) {
commandline._autocompleteTimer.flush();
if (this._caret != this.caret)
this.reset();
this._caret = this.caret;
// Check if we need to run the completer.
if (this.context.waitingForTab || this.wildIndex == -1)
this.complete(true, true);