Skip to content

Commit fb626dc

Browse files
committed
git-gui: Bind Tab/Shift-Tab to cycle between panes in blame
The blame viewer is composed of two different areas, the file area on top and the commit area on the bottom. If users are trying to shift the focus it is probably because they want to shift from one area to the other, so we just setup Tab and Shift-Tab to jump from the one half to the other in a cycle. Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 82a2d6b commit fb626dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/blame.tcl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ constructor new {i_commit i_path} {
272272
set cursorW %W
273273
tk_popup $w.ctxm %X %Y
274274
"
275+
bind $i <Shift-Tab> "[list focus $w_cviewer];break"
276+
bind $i <Tab> "[list focus $w_cviewer];break"
275277
}
276278

277279
foreach i [concat $w_columns $w_cviewer] {
@@ -287,8 +289,10 @@ constructor new {i_commit i_path} {
287289
bind $i <Control-Key-f> {catch {%W yview scroll 1 pages};break}
288290
}
289291

292+
bind $w_cviewer <Shift-Tab> "[list focus $w_file];break"
293+
bind $w_cviewer <Tab> "[list focus $w_file];break"
290294
bind $w_cviewer <Button-1> [list focus $w_cviewer]
291-
bind $top <Visibility> [list focus $top]
295+
bind $w_file <Visibility> [list focus $w_file]
292296

293297
grid configure $w.header -sticky ew
294298
grid configure $w.file_pane -sticky nsew

0 commit comments

Comments
 (0)