mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 13:48:00 +01:00
Fix sending "change" event on command-line history change. Closes issue #21.
This commit is contained in:
@@ -150,8 +150,9 @@ 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) {
|
||||||
self._autocompleteTimer.tell(false);
|
if (from !== "history")
|
||||||
|
self._autocompleteTimer.tell(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.registerCallback("cancel", modes.PROMPT, cancelPrompt);
|
this.registerCallback("cancel", modes.PROMPT, cancelPrompt);
|
||||||
@@ -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");
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user