1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 05:57:58 +01:00

Add CompletionContextoptions.jswait. Dont preview 1 character substrings.

This commit is contained in:
Kris Maglione
2008-11-28 16:15:45 +00:00
parent 0698afef24
commit e0a3e761ed
5 changed files with 130 additions and 6 deletions

View File

@@ -464,6 +464,14 @@ CompletionContext.prototype = {
context.incomplete = false;
}
},
wait: function wait(interruptable, timeout)
{
let end = Date.now() + timeout;
while (this.incomplete && (!timeout || Date.now() > end))
liberator.threadYield(true, interruptable);
return this.incomplete;
}
}
function Completion() //{{{
@@ -1015,8 +1023,7 @@ function Completion() //{{{
let res = context.fork.apply(context, ["run", 0, this, name].concat(Array.slice(arguments, 2)));
if (res) // FIXME
return { items: res.map(function (i) ({ item: i })) };
while (context.incomplete)
liberator.threadYield(true, true);
context.wait(true);
return context.allItems;
},