mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-07 18:44:10 +01:00
Fix Option.validateCompleter
This commit is contained in:
@@ -286,9 +286,9 @@ Option.prototype = {
|
|||||||
Option.validateCompleter = function (values)
|
Option.validateCompleter = function (values)
|
||||||
{
|
{
|
||||||
let context = CompletionContext("");
|
let context = CompletionContext("");
|
||||||
let res = this.completer(context);
|
let res = context.fork("", 0, this, this.completer);
|
||||||
if (!res)
|
if (!res)
|
||||||
res = context.allItems.map(function (item) [item.text]);
|
res = context.allItems.items.map(function (item) [item.text]);
|
||||||
return Array.concat(values).every(
|
return Array.concat(values).every(
|
||||||
function (value) res.some(function (item) item[0] == value));
|
function (value) res.some(function (item) item[0] == value));
|
||||||
}; //}}}
|
}; //}}}
|
||||||
|
|||||||
@@ -172,11 +172,12 @@ const template = {
|
|||||||
let n = 0;
|
let n = 0;
|
||||||
for (let [i, length] in iter)
|
for (let [i, length] in iter)
|
||||||
{
|
{
|
||||||
if (n++ > 8)
|
if (n++ > 50) // Prevent infinite loops.
|
||||||
return s + <>{str.substr(start)}</>;
|
return s + <>{str.substr(start)}</>;
|
||||||
XML.ignoreWhitespace = false;
|
XML.ignoreWhitespace = false;
|
||||||
s += <>{str.substring(start, i)}</>;
|
s += <>{str.substring(start, i)}</>;
|
||||||
s += highlight(str.substr(i, length));
|
s += highlight(str.substr(i, length));
|
||||||
|
liberator.dump(s);
|
||||||
start = i + length;
|
start = i + length;
|
||||||
}
|
}
|
||||||
return s + <>{str.substr(start)}</>;
|
return s + <>{str.substr(start)}</>;
|
||||||
|
|||||||
Reference in New Issue
Block a user