mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-30 11:23:31 +02:00
Preserve io.sourcing when evaluating custom completers.
This commit is contained in:
@@ -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 + " ...");
|
||||||
|
|||||||
Reference in New Issue
Block a user