mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-10 20:25:44 +01:00
Allow listCompleter to be interrupted.
This commit is contained in:
@@ -1130,7 +1130,7 @@ function Completion() //{{{
|
|||||||
let list = template.generic(
|
let list = template.generic(
|
||||||
<div highlight="Completions">
|
<div highlight="Completions">
|
||||||
{ template.completionRow(context.title, "CompTitle") }
|
{ 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>);
|
</div>);
|
||||||
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const template = {
|
|||||||
add: function add(a, b) a + b,
|
add: function add(a, b) a + b,
|
||||||
join: function join(c) function (a, b) a + c + 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? */
|
if (iter.length) /* Kludge? */
|
||||||
iter = util.Array.iterator(iter);
|
iter = util.Array.iterator(iter);
|
||||||
@@ -15,6 +15,8 @@ const template = {
|
|||||||
continue;
|
continue;
|
||||||
if (sep && n++)
|
if (sep && n++)
|
||||||
ret += sep;
|
ret += sep;
|
||||||
|
if (interruptable && n % interruptable == 0)
|
||||||
|
liberator.threadYield(true, true);
|
||||||
ret += val;
|
ret += val;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user