1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-01 10:02:26 +01:00

Fix async completion input update bugginess.

This commit is contained in:
Kris Maglione
2011-10-03 21:31:40 -04:00
parent 191f17bb4f
commit d3b647df42

View File

@@ -1111,6 +1111,7 @@ var CommandLine = Module("commandline", {
this._caret = this.caret;
this.input.dactylKeyPress = undefined;
this._completion = completion;
},
get caret() this.editor.selection.getRangeAt(0).startOffset,
@@ -1205,14 +1206,12 @@ var CommandLine = Module("commandline", {
if (this.waiting && this.waiting[0] == context)
this.select(this.waiting);
else if (!this.waiting) {
let group = this.itemList.selectedGroup;
if (group && group.context == context && this.completion) {
this.selected = null;
if (group.selectedIdx != null)
this.selected = [group.context, group.selectedIdx];
this.completion = this.selected ? this.getItem().result
: this.value;
let cursor = this.selected;
if (cursor && cursor[0] == context) {
if (cursor[1] >= context.items.length) {
this.selected = null;
this.itemList.select(null);
}
}
this.preview();