1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 21:18:00 +01:00

Wait for completion to finish before processing <Tab>

This commit is contained in:
Kris Maglione
2009-01-03 00:14:48 -05:00
parent f4b8edbb67
commit 81e0ae4bb5

View File

@@ -363,12 +363,14 @@ function CommandLine() //{{{
if (this.context.waitingForTab || this.wildIndex == -1) if (this.context.waitingForTab || this.wildIndex == -1)
this.complete(true, true); this.complete(true, true);
if (this.items.length == 0) // Would prefer to only do this check when no completion
// is available, but there are complications.
if (this.items.length == 0 || this.context.incomplete)
{ {
// No items. Wait for any unfinished completers. // No items. Wait for any unfinished completers.
let end = Date.now() + 5000; let end = Date.now() + 5000;
while (this.context.incomplete && this.items.length == 0 && Date.now() < end) while (this.context.incomplete && /* this.items.length == 0 && */ Date.now() < end)
liberator.threadYield(); liberator.threadYield(true, true);
if (this.items.length == 0) if (this.items.length == 0)
return liberator.beep(); return liberator.beep();