From: Shawn O. Pearce Date: Tue, 1 May 2007 19:51:09 +0000 (-0400) Subject: git-gui: Allow vi keys to scroll the diff/blame regions X-Git-Tag: gitgui-0.7.0-rc1~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=60aa065f6958a888d14178ca94f17a60100d3709;p=git.git 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 --- diff --git a/git-gui.sh b/git-gui.sh index 72673c627..dc6664c68 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2038,6 +2038,12 @@ bind $ui_diff {catch {%W yview scroll -1 units};break} bind $ui_diff {catch {%W yview scroll 1 units};break} bind $ui_diff {catch {%W xview scroll -1 units};break} bind $ui_diff {catch {%W xview scroll 1 units};break} +bind $ui_diff {catch {%W yview scroll -1 units};break} +bind $ui_diff {catch {%W yview scroll 1 units};break} +bind $ui_diff {catch {%W xview scroll -1 units};break} +bind $ui_diff {catch {%W xview scroll 1 units};break} +bind $ui_diff {catch {%W yview scroll -1 pages};break} +bind $ui_diff {catch {%W yview scroll 1 pages};break} bind $ui_diff {focus %W} if {[is_enabled branch]} { 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 {catch {%W yview scroll -1 units};break} + bind $i {catch {%W yview scroll 1 units};break} + bind $i {catch {%W xview scroll -1 units};break} + bind $i {catch {%W xview scroll 1 units};break} + bind $i {catch {%W yview scroll -1 units};break} + bind $i {catch {%W yview scroll 1 units};break} + bind $i {catch {%W xview scroll -1 units};break} + bind $i {catch {%W xview scroll 1 units};break} + bind $i {catch {%W yview scroll -1 pages};break} + bind $i {catch {%W yview scroll 1 pages};break} + } + bind $w.cm.t "focus $w.cm.t" bind $tl "focus $tl" bind $tl "