1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-01 12:12:28 +01:00

Preserve file/line information with saved ex commands (:au, :com, :map -ex).

This commit is contained in:
Kris Maglione
2010-10-05 15:29:18 -04:00
parent 2ee74581d1
commit 7f574a512f
8 changed files with 126 additions and 119 deletions

View File

@@ -330,7 +330,7 @@ const Dactyl = Module("dactyl", {
*/
userFunc: function () {
return this.userEval(
"(function (" +
"(function userFunction(" +
Array.slice(arguments, 0, -1).join(", ") +
") { " + arguments[arguments.length - 1] + " })");
},
@@ -344,7 +344,7 @@ const Dactyl = Module("dactyl", {
* @param {boolean} silent Whether the command should be echoed on the
* command line.
*/
execute: function (str, modifiers, silent) {
execute: function (str, modifiers, silent, sourcing) {
// skip comments and blank lines
if (/^\s*("|$)/.test(str))
return;
@@ -359,7 +359,10 @@ const Dactyl = Module("dactyl", {
if (!silent)
commandline.command = str.replace(/^\s*:\s*/, "");
command.execute(args, modifiers);
io.withSavedValues(["sourcing"], function () {
io.sourcing = sourcing || io.sourcing;
command.execute(args, modifiers);
});
}
},