1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-10 12:25:45 +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

@@ -764,6 +764,16 @@ Class.prototype = {
*/
init: function () {},
withSavedValues: function (names, callback, self) {
let vals = names.map(function (name) this[name], this);
try {
return callback.call(self || this);
}
finally {
names.forEach(function (name, i) this[name] = vals[i], this);
}
},
toString: function () "[instance " + this.constructor.className + "]",
/**