mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 767401 - Clearing the searched token in the scripts filter should also clear the 'find next' history; r=past
This commit is contained in:
parent
c58a0c7bb2
commit
9d03d7155a
@ -461,7 +461,7 @@ ScriptsView.prototype = {
|
||||
if (line > -1) {
|
||||
editor.setCaretPosition(line - 1);
|
||||
}
|
||||
if (token) {
|
||||
if (token.length) {
|
||||
let offset = editor.find(token, { ignoreCase: true });
|
||||
if (offset > -1) {
|
||||
editor.setSelection(offset, offset + token.length)
|
||||
@ -480,6 +480,10 @@ ScriptsView.prototype = {
|
||||
|
||||
if (e.keyCode === e.DOM_VK_RETURN || e.keyCode === e.DOM_VK_ENTER) {
|
||||
let token = this._getSearchboxInfo()[2];
|
||||
if (!token.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
let editor = DebuggerView.editor;
|
||||
let offset = editor.findNext(true);
|
||||
if (offset > -1) {
|
||||
|
@ -124,6 +124,23 @@ function testScriptSearching() {
|
||||
|
||||
|
||||
token = "debugger";
|
||||
write("#" + token);
|
||||
ok(gEditor.getCaretPosition().line == 2 &&
|
||||
gEditor.getCaretPosition().col == 44 + token.length,
|
||||
"The editor didn't jump to the correct token. (12.1)");
|
||||
|
||||
clear();
|
||||
EventUtils.sendKey("RETURN");
|
||||
ok(gEditor.getCaretPosition().line == 2 &&
|
||||
gEditor.getCaretPosition().col == 44 + token.length,
|
||||
"The editor shouldn't jump to another token. (12.2)");
|
||||
|
||||
EventUtils.sendKey("ENTER");
|
||||
ok(gEditor.getCaretPosition().line == 2 &&
|
||||
gEditor.getCaretPosition().col == 44 + token.length,
|
||||
"The editor shouldn't jump to another token. (12.3)");
|
||||
|
||||
|
||||
write(":1:2:3:a:b:c:::12");
|
||||
ok(gEditor.getCaretPosition().line == 11 &&
|
||||
gEditor.getCaretPosition().col == 0,
|
||||
|
Loading…
Reference in New Issue
Block a user