mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 00:17:58 +01:00
Deal with a race.
This commit is contained in:
@@ -330,6 +330,8 @@ var CommandMode = Class("CommandMode", {
|
|||||||
this.completions.autocompleteTimer.flush(true);
|
this.completions.autocompleteTimer.flush(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
get active() this === commandline.commandSession,
|
||||||
|
|
||||||
get holdFocus() this.widgets.active.command.inputField,
|
get holdFocus() this.widgets.active.command.inputField,
|
||||||
|
|
||||||
get mappingSelf() this,
|
get mappingSelf() this,
|
||||||
@@ -347,6 +349,8 @@ var CommandMode = Class("CommandMode", {
|
|||||||
|
|
||||||
leave: function (stack) {
|
leave: function (stack) {
|
||||||
if (!stack.push) {
|
if (!stack.push) {
|
||||||
|
commandline.commandSession = null;
|
||||||
|
|
||||||
if (this.completions)
|
if (this.completions)
|
||||||
this.completions.cleanup();
|
this.completions.cleanup();
|
||||||
|
|
||||||
@@ -361,7 +365,6 @@ var CommandMode = Class("CommandMode", {
|
|||||||
commandline.hide();
|
commandline.hide();
|
||||||
this[this.accepted ? "onSubmit" : "onCancel"](commandline.command);
|
this[this.accepted ? "onSubmit" : "onCancel"](commandline.command);
|
||||||
}, this);
|
}, this);
|
||||||
commandline.commandSession = null;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -990,8 +993,8 @@ var CommandLine = Module("commandline", {
|
|||||||
if (events.feedingKeys)
|
if (events.feedingKeys)
|
||||||
this.ignoredCount++;
|
this.ignoredCount++;
|
||||||
if (options["autocomplete"].length) {
|
if (options["autocomplete"].length) {
|
||||||
this.complete(true, false);
|
|
||||||
this.itemList.visible = true;
|
this.itemList.visible = true;
|
||||||
|
this.complete(true, false);
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
this.tabTimer = Timer(0, 0, function tabTell(event) {
|
this.tabTimer = Timer(0, 0, function tabTell(event) {
|
||||||
@@ -1061,6 +1064,8 @@ var CommandLine = Module("commandline", {
|
|||||||
this.context.reset();
|
this.context.reset();
|
||||||
this.context.tabPressed = tabPressed;
|
this.context.tabPressed = tabPressed;
|
||||||
this.session.complete(this.context);
|
this.session.complete(this.context);
|
||||||
|
if (this.session.active)
|
||||||
|
return;
|
||||||
this.context.updateAsync = true;
|
this.context.updateAsync = true;
|
||||||
this.reset(show, tabPressed);
|
this.reset(show, tabPressed);
|
||||||
this.wildIndex = 0;
|
this.wildIndex = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user