summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a35d65d)
raw | patch | inline | side by side (parent: a35d65d)
author | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 1 May 2007 19:51:09 +0000 (15:51 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 8 May 2007 03:35:51 +0000 (23:35 -0400) |
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>
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>
git-gui.sh | patch | blob | history | |
lib/blame.tcl | patch | blob | history |
diff --git a/git-gui.sh b/git-gui.sh
index 72673c627ab881731d07b97710eaf030a4420f7a..dc6664c68e77539072f67722dfff16fdb00749f1 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
bind $ui_diff <Key-Down> {catch {%W yview scroll 1 units};break}
bind $ui_diff <Key-Left> {catch {%W xview scroll -1 units};break}
bind $ui_diff <Key-Right> {catch {%W xview scroll 1 units};break}
+bind $ui_diff <Key-k> {catch {%W yview scroll -1 units};break}
+bind $ui_diff <Key-j> {catch {%W yview scroll 1 units};break}
+bind $ui_diff <Key-h> {catch {%W xview scroll -1 units};break}
+bind $ui_diff <Key-l> {catch {%W xview scroll 1 units};break}
+bind $ui_diff <Control-Key-b> {catch {%W yview scroll -1 pages};break}
+bind $ui_diff <Control-Key-f> {catch {%W yview scroll 1 pages};break}
bind $ui_diff <Button-1> {focus %W}
if {[is_enabled branch]} {
diff --git a/lib/blame.tcl b/lib/blame.tcl
index c276fa9852aeb3b383a62da31a805e79537c78c6..6d894e52d4d42b35f72cb2f66d56df480b5cd385 100644 (file)
--- a/lib/blame.tcl
+++ b/lib/blame.tcl
"
}
+ 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> "