1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-07 04:35:45 +01:00

Allow listCompleter to be interrupted.

This commit is contained in:
Kris Maglione
2008-11-28 17:27:17 +00:00
parent e3feb4ce87
commit 81802a2876
2 changed files with 4 additions and 2 deletions

View File

@@ -1130,7 +1130,7 @@ function Completion() //{{{
let list = template.generic(
<div highlight="Completions">
{ template.completionRow(context.title, "CompTitle") }
{ template.map(context.items, function (item) context.createRow(item)) }
{ template.map(context.items, function (item) context.createRow(item), null, 50) }
</div>);
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
},

View File

@@ -2,7 +2,7 @@ const template = {
add: function add(a, b) a + b,
join: function join(c) function (a, b) a + c + b,
map: function map(iter, fn, sep)
map: function map(iter, fn, sep, interruptable)
{
if (iter.length) /* Kludge? */
iter = util.Array.iterator(iter);
@@ -15,6 +15,8 @@ const template = {
continue;
if (sep && n++)
ret += sep;
if (interruptable && n % interruptable == 0)
liberator.threadYield(true, true);
ret += val;
}
return ret;