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:
@@ -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 + "]",
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user