Skip to content

Commit

Permalink
keyboardNavigation: Fix keys 'c' and 'v' from webView
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
heipei authored and Pieter de Bie committed Jun 11, 2009
1 parent ce3d8ae commit 60908fd
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions html/lib/keyboardNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ var handleKeys = function(event) {
return changeFile(true);
else if (event.keyCode == 38 && event.ctrlKey == true) // ctrl-up_arrow
return changeFile(false);
else if (event.keyCode == 86) {// 'v'
showDiffs();
return false;
}
else if (event.keyCode == 86) // 'v'
showDiff();
else if (event.keyCode == 67) // 'c'
Controller.copySource();
return true;
}

Expand All @@ -29,12 +29,8 @@ var handleKeyFromCocoa = function(key) {
changeHunk(true);
else if (key == 'k')
changeHunk(false);
else if (event.keyCode == 40 && event.ctrlKey == true) // ctrl-down_arrow
changeFile(true);
else if (event.keyCode == 38 && event.ctrlKey == true) // ctrl-up_arrow
changeFile(false);
else if (key == 'v')
showDiffs();
showDiff();
else if (key == 'c')
Controller.copySource();
}
Expand Down

0 comments on commit 60908fd

Please sign in to comment.