1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 15:48:00 +01:00

Fix sending "change" event on command-line history change. Closes issue #21.

This commit is contained in:
Kris Maglione
2010-09-24 11:22:49 -04:00
parent a99c586d98
commit 5a71f24eaa

View File

@@ -150,7 +150,8 @@ const CommandLine = Module("commandline", {
this.registerCallback("complete", modes.EX, function (context) { this.registerCallback("complete", modes.EX, function (context) {
context.fork("ex", 0, completion, "ex"); context.fork("ex", 0, completion, "ex");
}); });
this.registerCallback("change", modes.EX, function (command) { this.registerCallback("change", modes.EX, function (command, from) {
if (from !== "history")
self._autocompleteTimer.tell(false); self._autocompleteTimer.tell(false);
}); });
@@ -347,9 +348,9 @@ const CommandLine = Module("commandline", {
this._callbacks[type][mode] = func; this._callbacks[type][mode] = func;
}, },
triggerCallback: function (type, mode, data) { triggerCallback: function (type, mode) {
if (this._callbacks[type] && this._callbacks[type][mode]) if (this._callbacks[type] && this._callbacks[type][mode])
this._callbacks[type][mode].call(this, data); this._callbacks[type][mode].apply(this, Array.slice(arguments, 2));
}, },
runSilently: function (func, self) { runSilently: function (func, self) {
@@ -1058,7 +1059,7 @@ const CommandLine = Module("commandline", {
*/ */
replace: function (val) { replace: function (val) {
this.input.value = val; this.input.value = val;
commandline.triggerCallback("change", this._currentExtendedMode, val); commandline.triggerCallback("change", commandline._currentExtendedMode, val, "history");
}, },
/** /**