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:
@@ -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 + " ...");
|
||||
|
||||
Reference in New Issue
Block a user