1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-01 16:15:47 +01:00

Fix :run command

This commit is contained in:
anekos
2009-11-27 23:55:20 +09:00
parent 3256577767
commit 78308e2483

View File

@@ -950,16 +950,16 @@ lookup:
arg = "!" + arg; arg = "!" + arg;
// replaceable bang and no previous command? // replaceable bang and no previous command?
liberator.assert(!/((^|[^\\])(\\\\)*)!/.test(arg) || this._lastRunCommand, liberator.assert(!/((^|[^\\])(\\\\)*)!/.test(arg) || io._lastRunCommand,
"E34: No previous command"); "E34: No previous command");
// NOTE: Vim doesn't replace ! preceded by 2 or more backslashes and documents it - desirable? // NOTE: Vim doesn't replace ! preceded by 2 or more backslashes and documents it - desirable?
// pass through a raw bang when escaped or substitute the last command // pass through a raw bang when escaped or substitute the last command
arg = arg.replace(/(\\)*!/g, arg = arg.replace(/(\\)*!/g,
function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", this._lastRunCommand) function (m) /^\\(\\\\)*!$/.test(m) ? m.replace("\\!", "!") : m.replace("!", io._lastRunCommand)
); );
this._lastRunCommand = arg; io._lastRunCommand = arg;
let output = io.system(arg); let output = io.system(arg);