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

Fix idiocy. Closes issue #496.

This commit is contained in:
Kris Maglione
2011-04-08 04:48:34 -04:00
parent d622b4decc
commit e88490ef7d
3 changed files with 8 additions and 15 deletions

View File

@@ -1411,20 +1411,13 @@ var Commands = Module("commands", {
if (/^custom,/.test(completer)) {
completer = completer.substr(7);
let context = update({}, contexts.context || {});
if (contexts.context)
var ctxt = update({}, contexts.context || {});
completerFunc = function (context) {
try {
var result = contextswithSavedValues(["context"], function () {
contexts.context = context;
return dactyl.userEval(completer);
});
}
catch (e) {
dactyl.echo(":" + this.name + " ..."); // XXX
dactyl.echoerr(_("command.unknownCompleter", completer));
dactyl.log(e);
return undefined;
}
var result = contexts.withSavedValues(["context"], function () {
contexts.context = ctxt;
return dactyl.userEval(completer);
});
if (callable(result))
return result.apply(this, Array.slice(arguments));
else