diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-05-01 15:51:09 -0400 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-05-07 23:35:51 -0400 |
commit | 60aa065f6958a888d14178ca94f17a60100d3709 (patch) | |
tree | 8f665c9f5d8d923ec5aadbbfecfe649315946465 /lib | |
parent | a35d65d9c8a2a6a10d369c00e22aded6fbdff2a9 (diff) | |
download | git-60aa065f6958a888d14178ca94f17a60100d3709.tar.gz git-60aa065f6958a888d14178ca94f17a60100d3709.tar.xz |
git-gui: Allow vi keys to scroll the diff/blame regions
Users who are used to vi and recent versions of gitk may want
to scroll the diff region using vi style keybindings. Since
these aren't bound to anything else and that widget does not
accept focus for data input, we can easily support that too.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/blame.tcl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/blame.tcl b/lib/blame.tcl index c276fa985..6d894e52d 100644 --- a/lib/blame.tcl +++ b/lib/blame.tcl @@ -125,6 +125,23 @@ proc show_blame {commit path} { " } + foreach i [list \ + $w.out.loaded_t \ + $w.out.linenumber_t \ + $w.out.file_t \ + $w.cm.t] { + bind $i <Key-Up> {catch {%W yview scroll -1 units};break} + bind $i <Key-Down> {catch {%W yview scroll 1 units};break} + bind $i <Key-Left> {catch {%W xview scroll -1 units};break} + bind $i <Key-Right> {catch {%W xview scroll 1 units};break} + bind $i <Key-k> {catch {%W yview scroll -1 units};break} + bind $i <Key-j> {catch {%W yview scroll 1 units};break} + bind $i <Key-h> {catch {%W xview scroll -1 units};break} + bind $i <Key-l> {catch {%W xview scroll 1 units};break} + bind $i <Control-Key-b> {catch {%W yview scroll -1 pages};break} + bind $i <Control-Key-f> {catch {%W yview scroll 1 pages};break} + } + bind $w.cm.t <Button-1> "focus $w.cm.t" bind $tl <Visibility> "focus $tl" bind $tl <Destroy> " |