Skip to content

Commit 375dd7f

Browse files
committed
don't look for match while IME is composing
1 parent 16cdd08 commit 375dd7f

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

common/content/commandline.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,16 @@ const CommandLine = Module("commandline", {
421421
}
422422
},
423423

424+
_isIMEComposing: false,
425+
426+
onCompositionStart: function(e) {
427+
this._isIMEComposing = true;
428+
},
429+
430+
onCompositionEnd: function(e) {
431+
this._isIMEComposing = false;
432+
},
433+
424434
get command() {
425435
try {
426436
// The long path is because of complications with the
@@ -1529,6 +1539,12 @@ const CommandLine = Module("commandline", {
15291539
literal: 0
15301540
});
15311541
},
1542+
events: function() {
1543+
// The commandline should know when the user is inputting complex text, some functionalities may depend on it; i.e. finder.js
1544+
let textbox = document.getElementById("liberator-commandline-command");
1545+
events.addSessionListener(textbox, "compositionstart", this.closure.onCompositionStart);
1546+
events.addSessionListener(textbox, "compositionend", this.closure.onCompositionEnd);
1547+
},
15321548
mappings: function () {
15331549
var myModes = [modes.COMMAND_LINE];
15341550

common/content/finder.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ var Finder = Module("finder", {
100100
this._backwards = mode == modes.SEARCH_BACKWARD;
101101
//commandline.open(this._backwards ? "Find backwards" : "Find", "", mode);
102102
commandline.input(this._backwards ? "Find backwards" : "Find", this.closure.onSubmit, {
103-
onChange: function() { if (options["incsearch"]) finder.find(commandline.command) }
103+
onChange: function() {
104+
if (options["incsearch"] && !commandline._isIMEComposing) {
105+
finder.find(commandline.command);
106+
}
107+
}
104108
});
105109
//modes.extended = mode;
106110

0 commit comments

Comments
 (0)