mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-05 06:15:47 +01:00
Fix rangefinder search history issue.
This commit is contained in:
@@ -399,14 +399,13 @@ var CommandMode = Class("CommandMode", {
|
||||
return true; /* Pass event */
|
||||
},
|
||||
|
||||
onCancel: function (value) {
|
||||
},
|
||||
onCancel: function (value) {},
|
||||
|
||||
onChange: function (value) {
|
||||
},
|
||||
onChange: function (value) {},
|
||||
|
||||
onSubmit: function (value) {
|
||||
},
|
||||
onHistory: function (value) {},
|
||||
|
||||
onSubmit: function (value) {},
|
||||
|
||||
resetCompletions: function resetCompletions() {
|
||||
if (this.completions) {
|
||||
@@ -941,6 +940,7 @@ var CommandLine = Module("commandline", {
|
||||
if (this.completions)
|
||||
this.completions.previewClear();
|
||||
this.input.value = val;
|
||||
this.session.onHistory(val);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -346,7 +346,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
echoerr: function echoerr(str, flags) {
|
||||
flags |= commandline.APPEND_TO_MESSAGES;
|
||||
|
||||
if (isinstance(str, ["Error", "Exception"]) || isinstance(str, [XPCWrappedNative_NoHelper]) && /^\[Exception/.test(str))
|
||||
if (isinstance(str, ["Error", "Exception"]) || isinstance(str, ["XPCWrappedNative_NoHelper"]) && /^\[Exception/.test(str))
|
||||
dactyl.reportError(str);
|
||||
if (isObject(str) && "echoerr" in str)
|
||||
str = str.echoerr;
|
||||
|
||||
@@ -103,10 +103,6 @@ var ProcessorStack = Class("ProcessorStack", {
|
||||
|
||||
events.dbg("RESULT: " + length + " " + this._result(result));
|
||||
|
||||
if (result === Events.PASS || result === Events.PASS_THROUGH)
|
||||
if (this.events[0].originalTarget)
|
||||
this.events[0].originalTarget.dactylKeyPress = undefined;
|
||||
|
||||
if (result !== Events.PASS || this.events.length > 1)
|
||||
if (result !== Events.ABORT || !this.events[0].isReplay)
|
||||
Events.kill(this.events[this.events.length - 1]);
|
||||
@@ -327,6 +323,9 @@ var EventHive = Class("EventHive", Contexts.Hive, {
|
||||
[,, capture, allowUntrusted] = arguments;
|
||||
}
|
||||
|
||||
if (set.has(events, "input") && !set.has(events, "dactyl-input"))
|
||||
events["dactyl-input"] = events.input;
|
||||
|
||||
for (let [event, callback] in Iterator(events)) {
|
||||
let args = [Cu.getWeakReference(target),
|
||||
event,
|
||||
@@ -731,7 +730,7 @@ var Events = Module("events", {
|
||||
}
|
||||
};
|
||||
const TYPES = {
|
||||
change: "", input: "", submit: "",
|
||||
change: "", "dactyl-input": "", input: "", submit: "",
|
||||
click: "Mouse", mousedown: "Mouse", mouseup: "Mouse",
|
||||
mouseover: "Mouse", mouseout: "Mouse",
|
||||
keypress: "Key", keyup: "Key", keydown: "Key"
|
||||
@@ -1199,7 +1198,7 @@ var Events = Module("events", {
|
||||
elem.dactylKeyPress = elem.value;
|
||||
util.timeout(function () {
|
||||
if (elem.dactylKeyPress !== undefined && elem.value !== elem.dactylKeyPress)
|
||||
events.dispatch(elem, events.create(elem.ownerDocument, "input"));
|
||||
events.dispatch(elem, events.create(elem.ownerDocument, "dactyl-input"));
|
||||
elem.dactylKeyPress = undefined;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -132,6 +132,10 @@ var RangeFinder = Module("rangefinder", {
|
||||
}
|
||||
},
|
||||
|
||||
onHistory: function () {
|
||||
this.rangeFind.found = false;
|
||||
},
|
||||
|
||||
onSubmit: function (command) {
|
||||
if (!this.options["incfind"] || !this.rangeFind || !this.rangeFind.found) {
|
||||
this.clear();
|
||||
@@ -200,6 +204,7 @@ var RangeFinder = Module("rangefinder", {
|
||||
|
||||
get onCancel() modules.rangefinder.closure.onCancel,
|
||||
get onChange() modules.rangefinder.closure.onChange,
|
||||
get onHistory() modules.rangefinder.closure.onHistory,
|
||||
get onSubmit() modules.rangefinder.closure.onSubmit
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user