Skip to content

Commit ab870c6

Browse files
committed
keyboardNavigation: Fix keys 'c' and 'v' from webView
This fixes two small bugs: 1. The JavaScript-method is called "showDiff" instead of "showDiffs" since cfbcfc1. That's why the 'v' button didn't work since then. 2. Commit f05d018 introduced an error when trying to access "event" for key-presses from Cocoa, which resulted in an error and therefore made the following if-statements unreachable. Signed-off-by: Johannes Gilger <[email protected]>
1 parent 13746a5 commit ab870c6

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

html/lib/keyboardNavigation.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ var handleKeys = function(event) {
1717
return changeFile(true);
1818
else if (event.keyCode == 38 && event.ctrlKey == true) // ctrl-up_arrow
1919
return changeFile(false);
20-
else if (event.keyCode == 86) {// 'v'
21-
showDiffs();
22-
return false;
23-
}
20+
else if (event.keyCode == 86) // 'v'
21+
showDiff();
22+
else if (event.keyCode == 67) // 'c'
23+
Controller.copySource();
2424
return true;
2525
}
2626

@@ -29,12 +29,8 @@ var handleKeyFromCocoa = function(key) {
2929
changeHunk(true);
3030
else if (key == 'k')
3131
changeHunk(false);
32-
else if (event.keyCode == 40 && event.ctrlKey == true) // ctrl-down_arrow
33-
changeFile(true);
34-
else if (event.keyCode == 38 && event.ctrlKey == true) // ctrl-up_arrow
35-
changeFile(false);
3632
else if (key == 'v')
37-
showDiffs();
33+
showDiff();
3834
else if (key == 'c')
3935
Controller.copySource();
4036
}

0 commit comments

Comments
 (0)