1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-06 09:45:46 +01: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 (/^custom,/.test(completer)) {
completer = completer.substr(7);
let sourcing = update({}, io.sourcing || {});
completerFunc = function (context) {
try {
var result = dactyl.userEval(completer);
var result = io.withSavedValues(["sourcing"], function () {
io.sourcing = sourcing;
return dactyl.userEval(completer);
});
}
catch (e) {
dactyl.echo(":" + this.name + " ...");