This commit is contained in:
Ryan VanderMeulen 2013-07-02 15:13:58 -04:00
Родитель bfff133066 cb800508e0
Коммит 8994a7c5a2
3 изменённых файлов: 22 добавлений и 22 удалений

Просмотреть файл

@ -123,13 +123,13 @@ const DEFAULT_KEYBINDINGS = [
action: "Move to Bracket Opening",
code: Ci.nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET,
accel: true,
shift: true,
alt: true,
},
{
action: "Move to Bracket Closing",
code: Ci.nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET,
accel: true,
shift: true,
alt: true,
},
];

Просмотреть файл

@ -53,33 +53,33 @@ function test() {
// Setting caret at Line 1 bracket start.
editor.setCaretOffset(19);
EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 220,
"JS : Jump to closing bracket of the code block when caret at block start");
EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 20,
"JS : Jump to opening bracket of the code block when caret at block end");
// Setting caret at Line 10 start.
editor.setCaretOffset(161);
EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 20,
"JS : Jump to opening bracket of code block when inside the function");
editor.setCaretOffset(161);
EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 220,
"JS : Jump to closing bracket of code block when inside the function");
// Setting caret at Line 6 start.
editor.setCaretOffset(67);
EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 159,
"JS : Jump to closing bracket in a nested function with caret inside");
editor.setCaretOffset(67);
EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 62,
"JS : Jump to opening bracket in a nested function with caret inside");
@ -93,22 +93,22 @@ function test() {
// Setting caret at Line 1 bracket start.
editor.setCaretOffset(8);
EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 45,
"CSS : Jump to closing bracket of the code block when caret at block start");
EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 9,
"CSS : Jump to opening bracket of the code block when caret at block end");
// Setting caret at Line 3 start.
editor.setCaretOffset(28);
EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 9,
"CSS : Jump to opening bracket of code block when inside the function");
editor.setCaretOffset(28);
EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 45,
"CSS : Jump to closing bracket of code block when inside the function");
@ -124,13 +124,13 @@ function test() {
// Setting caret at Line 1 end.
editor.setCaretOffset(6);
EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 6,
"HTML : Jump to block end : Nothing happens in html mode");
// Setting caret at Line 4 end.
editor.setCaretOffset(64);
EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 64,
"HTML : Jump to block start : Nothing happens in html mode");
@ -144,13 +144,13 @@ function test() {
// Setting caret at Line 1 start.
editor.setCaretOffset(0);
EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 0,
"Text : Jump to block end : Nothing happens in text mode");
// Setting caret at Line 4 end.
editor.setCaretOffset(28);
EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 28,
"Text : Jump to block start : Nothing happens in text mode");

Просмотреть файл

@ -57,15 +57,15 @@ function test() {
// Setting caret at end of line 11 (function baz() {).
editor.setCaretOffset(147);
EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 16,
"JS : Jump to opening bracket of previous sibling block when no parent");
EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 129,
"JS : Jump to closing bracket of same code block");
EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 151,
"JS : Jump to closing bracket of next sibling code block");
@ -82,15 +82,15 @@ function test() {
// Setting caret at Line 5 end (.class1 {).
editor.setCaretOffset(57);
EventUtils.synthesizeKey("[", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("[", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 10,
"CSS : Jump to opening bracket of previous sibling code block");
EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 46,
"CSS : Jump to closing bracket of same code block");
EventUtils.synthesizeKey("]", {accelKey: true, shiftKey: true}, testWin);
EventUtils.synthesizeKey("]", {accelKey: true, altKey: true}, testWin);
is(editor.getCaretOffset(), 77,
"CSS : Jump to closing bracket of next sibling code block");