Bug 928315 - Adding functionlity to allow Shift+Enter to search backwards in the debugger, r=vporof

This commit is contained in:
Jacob Clark 2013-10-20 17:50:20 +03:00
parent 52521fc0ad
commit 8b3df29479
2 changed files with 24 additions and 1 deletions

View File

@ -970,7 +970,10 @@ FilterView.prototype = {
else switch (e.keyCode) {
case e.DOM_VK_RETURN:
case e.DOM_VK_ENTER:
var isReturnKey = true; // Fall through.
var isReturnKey = true;
// If the shift key is pressed, focus on the previous result
actionToPerform = e.shiftKey ? "selectPrev" : "selectNext";
break;
case e.DOM_VK_DOWN:
actionToPerform = "selectNext";
break;

View File

@ -26,6 +26,26 @@ function test() {
}
function performTest() {
setText(gSearchBox, "#html");
EventUtils.synthesizeKey("VK_RETURN", { shiftKey: true }, gDebugger);
is(gFiltering.searchData.toSource(), '["#", ["", "html"]]',
"The searchbox data wasn't parsed correctly.");
ok(isCaretPos(gPanel, 35, 7),
"The editor didn't jump to the correct line.");
EventUtils.synthesizeKey("VK_RETURN", { shiftKey: true }, gDebugger);
is(gFiltering.searchData.toSource(), '["#", ["", "html"]]',
"The searchbox data wasn't parsed correctly.");
ok(isCaretPos(gPanel, 5, 6),
"The editor didn't jump to the correct line.");
EventUtils.synthesizeKey("VK_RETURN", { shiftKey: true }, gDebugger);
is(gFiltering.searchData.toSource(), '["#", ["", "html"]]',
"The searchbox data wasn't parsed correctly.");
ok(isCaretPos(gPanel, 3, 15),
"The editor didn't jump to the correct line.");
setText(gSearchBox, ":12");
is(gFiltering.searchData.toSource(), '[":", ["", 12]]',
"The searchbox data wasn't parsed correctly.");