1
0
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:
Kris Maglione
2008-12-01 20:51:40 +00:00
parent a2550499c8
commit e7248c8b8b
2 changed files with 4 additions and 3 deletions

View File

@@ -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));
}; //}}}

View File

@@ -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)}</>;