Skip to content

Commit 729ffa5

Browse files
chungaspearce
authored andcommitted
git-gui: use +/- instead of ]/[ to show more/less context in diff
On some systems, brackets cannot be used as event details (they don't have a keysym), so use +/- instead (both on keyboard and keypad) and add ctrl-= as a synonym of ctrl-+ for convenience. [sp: Had to change accelerator to show only "$M1T-="; the original version included "$M1T-+ $M1T-=" but this is not drawn at all on Mac OS X.] Signed-off-by: Michele Ballabio <barra_cuda@katamail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
1 parent ccb3b53 commit 729ffa5

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

git-gui.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,11 +2064,11 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
20642064
20652065
.mbar.commit add command -label [mc "Show Less Context"] \
20662066
-command show_less_context \
2067-
-accelerator $M1T-\[
2067+
-accelerator $M1T-\-
20682068
20692069
.mbar.commit add command -label [mc "Show More Context"] \
20702070
-command show_more_context \
2071-
-accelerator $M1T-\]
2071+
-accelerator $M1T-=
20722072
20732073
.mbar.commit add separator
20742074
@@ -2715,8 +2715,11 @@ bind $ui_comm <$M1B-Key-v> {tk_textPaste %W; %W see insert; break}
27152715
bind $ui_comm <$M1B-Key-V> {tk_textPaste %W; %W see insert; break}
27162716
bind $ui_comm <$M1B-Key-a> {%W tag add sel 0.0 end;break}
27172717
bind $ui_comm <$M1B-Key-A> {%W tag add sel 0.0 end;break}
2718-
bind $ui_comm <$M1B-Key-bracketleft> {show_less_context;break}
2719-
bind $ui_comm <$M1B-Key-bracketright> {show_more_context;break}
2718+
bind $ui_comm <$M1B-Key-minus> {show_less_context;break}
2719+
bind $ui_comm <$M1B-Key-KP_Subtract> {show_less_context;break}
2720+
bind $ui_comm <$M1B-Key-equal> {show_more_context;break}
2721+
bind $ui_comm <$M1B-Key-plus> {show_more_context;break}
2722+
bind $ui_comm <$M1B-Key-KP_Add> {show_more_context;break}
27202723
27212724
bind $ui_diff <$M1B-Key-x> {tk_textCopy %W;break}
27222725
bind $ui_diff <$M1B-Key-X> {tk_textCopy %W;break}
@@ -2760,8 +2763,11 @@ bind . <$M1B-Key-t> do_add_selection
27602763
bind . <$M1B-Key-T> do_add_selection
27612764
bind . <$M1B-Key-i> do_add_all
27622765
bind . <$M1B-Key-I> do_add_all
2763-
bind . <$M1B-Key-bracketleft> {show_less_context;break}
2764-
bind . <$M1B-Key-bracketright> {show_more_context;break}
2766+
bind . <$M1B-Key-minus> {show_less_context;break}
2767+
bind . <$M1B-Key-KP_Subtract> {show_less_context;break}
2768+
bind . <$M1B-Key-equal> {show_more_context;break}
2769+
bind . <$M1B-Key-plus> {show_more_context;break}
2770+
bind . <$M1B-Key-KP_Add> {show_more_context;break}
27652771
bind . <$M1B-Key-Return> do_commit
27662772
foreach i [list $ui_index $ui_workdir] {
27672773
bind $i <Button-1> "toggle_or_diff $i %x %y; break"

0 commit comments

Comments
 (0)