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:
@@ -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);
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user