Skip to content

Commit

Permalink
Add 'v' as a shortcut to show large diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
pieter committed Sep 12, 2008
1 parent ce2fa79 commit 978a22c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PBCommitList.m
Expand Up @@ -22,7 +22,7 @@ - (void) keyDown: (id) event
else
[webView scrollPageDown: self];
}
else if ([character rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"jk"]].location == 0)
else if ([character rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"jkv"]].location == 0)
[webController sendKey: character];
else
[super keyDown: event];
Expand Down
2 changes: 1 addition & 1 deletion html/commit.js
Expand Up @@ -72,7 +72,7 @@ var loadCommit = function() {
if (commit.diff.length < 10000) {
showDiffs();
} else {
$("details").innerHTML = "<a class='showdiff' href='' onclick='showDiffs(); return false;'>This is a large commit. Click here to show the diff.</a>";
$("details").innerHTML = "<a class='showdiff' href='' onclick='showDiffs(); return false;'>This is a large commit. Click here or press 'v' to view.</a>";
}

scroll(0, 0);
Expand Down
7 changes: 6 additions & 1 deletion html/keyboardNavigation.js
Expand Up @@ -10,7 +10,10 @@ var handleKeys = function(event) {
return changeHunk(true);
else if (event.keyCode == 75)
return changeHunk(false);

else if (event.keyCode == 86) {// 'v'
showDiffs();
return false;
}
return true;
}

Expand All @@ -19,6 +22,8 @@ var handleKeyFromCocoa = function(key) {
changeHunk(true);
else if (key == 'k')
changeHunk(false);
else if (key == 'v')
showDiffs();
}

var changeHunk = function(next) {
Expand Down

0 comments on commit 978a22c

Please sign in to comment.