From 982d07af5572e17ab6ac5e82573307661de6f453 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 19 Jan 2011 19:05:45 -0500 Subject: [PATCH] Preserve io.sourcing when evaluating custom completers. --- common/content/commands.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/content/commands.js b/common/content/commands.js index 0bd57a01..34726009 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -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 + " ...");