1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 22:37:58 +01:00

Clear highlighting on page unload, etc.

This commit is contained in:
Kris Maglione
2009-11-13 19:17:34 -05:00
parent a9f8e825b9
commit 00697620ca
5 changed files with 80 additions and 13 deletions

View File

@@ -1115,25 +1115,46 @@ const Completion = Module("completion", {
context.filters.push(function (item) util.compareIgnoreCase(item.text.substr(0, this.filter.length), this.filter));
if (obj == cache.evalContext)
context.regenerate = true;
context.generate = function () self.objectKeys(obj, !recurse);
context.generate = function () {
try {
return self.objectKeys(obj, !recurse)
}
catch(e) {
liberator.reportError(e);
}
};
};
}
// TODO: Make this a generic completion helper function.
let filter = key + (string || "");
for (let [, obj] in Iterator(objects)) {
this.context.fork(obj[1], top[OFFSET], this, fill,
obj[0], obj[1], compl, compl != orig, filter, last, key.length);
obj[0], obj[1], compl,
true, filter, last, key.length);
}
if (orig)
return;
for (let [, obj] in Iterator(objects)) {
let name = obj[1] + " (prototypes)";
this.context.fork(name, top[OFFSET], this, fill,
obj[0], name, function (a, b) compl(a, b, true), compl != orig,
filter, last, key.length);
obj[1] += " (substrings)";
obj[0], name, function (a, b) compl(a, b, true),
true, filter, last, key.length);
}
for (let [, obj] in Iterator(objects)) {
let name = obj[1] + " (substrings)";
this.context.fork(obj[1], top[OFFSET], this, fill,
obj[0], obj[1], compl, false, filter, last, key.length);
obj[0], name, compl,
false, filter, last, key.length);
}
for (let [, obj] in Iterator(objects)) {
let name = obj[1] + " (prototype substrings)";
this.context.fork(obj[1], top[OFFSET], this, fill,
obj[0], name, function (a, b) compl(a, b, true),
false, filter, last, key.length);
}
}