mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-22 11:15:47 +01:00
Don't force help initialization until we see something that looks like a help link. Other small interface changes.
This commit is contained in:
@@ -466,12 +466,12 @@ var IO = Module("io", {
|
||||
res = this.run("/bin/sh", ["-e", cmd.path], true);
|
||||
}
|
||||
|
||||
let output = stdout.read();
|
||||
if (res > 0)
|
||||
output += "\nshell returned " + res;
|
||||
else if (output)
|
||||
output = output.replace(/^(.*)\n$/, "$1");
|
||||
return output;
|
||||
return {
|
||||
__noSuchMethod__: function (meth, args) this.output[meth].apply(this.output, args),
|
||||
valueOf: function () this.output,
|
||||
output: stdout.read().replace(/^(.*)\n$/, "$1"),
|
||||
returnValue: res
|
||||
};
|
||||
}) || "";
|
||||
},
|
||||
|
||||
@@ -831,10 +831,12 @@ unlet s:cpo_save
|
||||
|
||||
io._lastRunCommand = arg;
|
||||
|
||||
let output = io.system(arg);
|
||||
let result = io.system(arg);
|
||||
if (result.returnValue != 0)
|
||||
result.output += "\nshell returned " + res;
|
||||
|
||||
modules.commandline.command = "!" + arg;
|
||||
modules.commandline.commandOutput(<span highlight="CmdOutput">{output}</span>);
|
||||
modules.commandline.commandOutput(<span highlight="CmdOutput">{result.output}</span>);
|
||||
|
||||
modules.autocommands.trigger("ShellCmdPost", {});
|
||||
}, {
|
||||
@@ -873,7 +875,8 @@ unlet s:cpo_save
|
||||
context.title = ["Environment Variable", "Value"];
|
||||
context.generate = function ()
|
||||
io.system(util.OS.isWindows ? "set" : "env")
|
||||
.split("\n").filter(function (line) line.indexOf("=") > 0)
|
||||
.output.split("\n")
|
||||
.filter(function (line) line.indexOf("=") > 0)
|
||||
.map(function (line) line.match(/([^=]+)=(.*)/).slice(1));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user