mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 02:57:59 +01:00
Remove a bit of now-superfluous code and fix Option#setFrom.
This commit is contained in:
@@ -428,7 +428,7 @@ const Commands = Module("commands", {
|
|||||||
io.withSavedValues(["readHeredoc", "sourcing"], function () {
|
io.withSavedValues(["readHeredoc", "sourcing"], function () {
|
||||||
this.sourcing = update({}, sourcing);
|
this.sourcing = update({}, sourcing);
|
||||||
|
|
||||||
args = update({ setFrom: this.file }, args || {});
|
args = update({ setFrom: this.sourcing.file }, args || {});
|
||||||
|
|
||||||
if (tokens)
|
if (tokens)
|
||||||
string = commands.replaceTokens(string, tokens);
|
string = commands.replaceTokens(string, tokens);
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
* @param {boolean} silent Whether the command should be echoed on the
|
* @param {boolean} silent Whether the command should be echoed on the
|
||||||
* command line.
|
* command line.
|
||||||
*/
|
*/
|
||||||
execute: function (str, modifiers, silent, sourcing) {
|
execute: function (str, modifiers, silent) {
|
||||||
// skip comments and blank lines
|
// skip comments and blank lines
|
||||||
if (/^\s*("|$)/.test(str))
|
if (/^\s*("|$)/.test(str))
|
||||||
return;
|
return;
|
||||||
@@ -332,10 +332,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
if (!silent)
|
if (!silent)
|
||||||
commandline.command = str.replace(/^\s*:\s*/, "");
|
commandline.command = str.replace(/^\s*:\s*/, "");
|
||||||
|
|
||||||
io.withSavedValues(["sourcing"], function () {
|
command.execute(args, modifiers);
|
||||||
io.sourcing = sourcing || io.sourcing;
|
|
||||||
command.execute(args, modifiers);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1171,7 +1171,7 @@ const Options = Module("options", {
|
|||||||
msg = " " + option.name + "=" + opt.optionValue;
|
msg = " " + option.name + "=" + opt.optionValue;
|
||||||
|
|
||||||
if (options["verbose"] > 0 && option.setFrom)
|
if (options["verbose"] > 0 && option.setFrom)
|
||||||
msg += "\n Last set from " + option.setFrom.path;
|
msg += "\n Last set from " + option.setFrom;
|
||||||
|
|
||||||
dactyl.echo(<span highlight="CmdOutput">{msg}</span>);
|
dactyl.echo(<span highlight="CmdOutput">{msg}</span>);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user