From 81e0ae4bb50f6e265c48f493533c3308cb57132c Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 3 Jan 2009 00:14:48 -0500 Subject: [PATCH] Wait for completion to finish before processing --- common/content/ui.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/content/ui.js b/common/content/ui.js index 28aeb3f7..00c86428 100644 --- a/common/content/ui.js +++ b/common/content/ui.js @@ -363,12 +363,14 @@ function CommandLine() //{{{ if (this.context.waitingForTab || this.wildIndex == -1) 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. let end = Date.now() + 5000; - while (this.context.incomplete && this.items.length == 0 && Date.now() < end) - liberator.threadYield(); + while (this.context.incomplete && /* this.items.length == 0 && */ Date.now() < end) + liberator.threadYield(true, true); if (this.items.length == 0) return liberator.beep();