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