summaryrefslogtreecommitdiff
path: root/git-gui/git-gui.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-04-02 17:29:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-04-02 17:29:10 (GMT)
commit7ae512b7da17e8f8c474fa80fb44b023c6f83882 (patch)
tree2e8baa4cbf4631504f68d65f88c8b64083b3e0da /git-gui/git-gui.sh
parent5fbd0a44cfee7be96fe29b9252f34b8f1bce9ac5 (diff)
parent3d654be48f65545c4d3e35f5d3bbed5489820930 (diff)
downloadgit-7ae512b7da17e8f8c474fa80fb44b023c6f83882.zip
git-7ae512b7da17e8f8c474fa80fb44b023c6f83882.tar.gz
git-7ae512b7da17e8f8c474fa80fb44b023c6f83882.tar.bz2
Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui: git-gui 0.10 git-gui: Add shortcut keys for Show More/Less Context
Diffstat (limited to 'git-gui/git-gui.sh')
-rwxr-xr-xgit-gui/git-gui.sh40
1 files changed, 32 insertions, 8 deletions
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 5e97fbf..8225cec 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -1846,6 +1846,22 @@ proc add_range_to_selection {w x y} {
$w tag add in_sel $begin.0 [expr {$end + 1}].0
}
+proc show_more_context {} {
+ global repo_config
+ if {$repo_config(gui.diffcontext) < 99} {
+ incr repo_config(gui.diffcontext)
+ reshow_diff
+ }
+}
+
+proc show_less_context {} {
+ global repo_config
+ if {$repo_config(gui.diffcontext) >= 1} {
+ incr repo_config(gui.diffcontext) -1
+ reshow_diff
+ }
+}
+
######################################################################
##
## ui construction
@@ -2046,6 +2062,16 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
.mbar.commit add separator
+ .mbar.commit add command -label [mc "Show Less Context"] \
+ -command show_less_context \
+ -accelerator $M1T-\[
+
+ .mbar.commit add command -label [mc "Show More Context"] \
+ -command show_more_context \
+ -accelerator $M1T-\]
+
+ .mbar.commit add separator
+
.mbar.commit add command -label [mc "Sign Off"] \
-command do_signoff \
-accelerator $M1T-S
@@ -2593,17 +2619,11 @@ lappend diff_actions [list $ctxm entryconf $ui_diff_applyhunk -state]
$ctxm add separator
$ctxm add command \
-label [mc "Show Less Context"] \
- -command {if {$repo_config(gui.diffcontext) >= 1} {
- incr repo_config(gui.diffcontext) -1
- reshow_diff
- }}
+ -command show_less_context
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add command \
-label [mc "Show More Context"] \
- -command {if {$repo_config(gui.diffcontext) < 99} {
- incr repo_config(gui.diffcontext)
- reshow_diff
- }}
+ -command show_more_context
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
$ctxm add separator
$ctxm add command \
@@ -2695,6 +2715,8 @@ bind $ui_comm <$M1B-Key-v> {tk_textPaste %W; %W see insert; break}
bind $ui_comm <$M1B-Key-V> {tk_textPaste %W; %W see insert; break}
bind $ui_comm <$M1B-Key-a> {%W tag add sel 0.0 end;break}
bind $ui_comm <$M1B-Key-A> {%W tag add sel 0.0 end;break}
+bind $ui_comm <$M1B-Key-\[> {show_less_context;break}
+bind $ui_comm <$M1B-Key-\]> {show_more_context;break}
bind $ui_diff <$M1B-Key-x> {tk_textCopy %W;break}
bind $ui_diff <$M1B-Key-X> {tk_textCopy %W;break}
@@ -2738,6 +2760,8 @@ bind . <$M1B-Key-t> do_add_selection
bind . <$M1B-Key-T> do_add_selection
bind . <$M1B-Key-i> do_add_all
bind . <$M1B-Key-I> do_add_all
+bind . <$M1B-Key-\[> {show_less_context;break}
+bind . <$M1B-Key-\]> {show_more_context;break}
bind . <$M1B-Key-Return> do_commit
foreach i [list $ui_index $ui_workdir] {
bind $i <Button-1> "toggle_or_diff $i %x %y; break"