1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-30 18:33:31 +02:00

Preserve io.sourcing when evaluating custom completers.

This commit is contained in:
Kris Maglione
2011-01-19 19:05:45 -05:00
parent 172c0058cf
commit 982d07af55

View File

@@ -1291,9 +1291,14 @@ var Commands = Module("commands", {
if (completer) { if (completer) {
if (/^custom,/.test(completer)) { if (/^custom,/.test(completer)) {
completer = completer.substr(7); completer = completer.substr(7);
let sourcing = update({}, io.sourcing || {});
completerFunc = function (context) { completerFunc = function (context) {
try { try {
var result = dactyl.userEval(completer); var result = io.withSavedValues(["sourcing"], function () {
io.sourcing = sourcing;
return dactyl.userEval(completer);
});
} }
catch (e) { catch (e) {
dactyl.echo(":" + this.name + " ..."); dactyl.echo(":" + this.name + " ...");