From: Shawn O. Pearce Date: Fri, 1 Jun 2007 03:34:24 +0000 (-0400) Subject: Merge branch 'maint' X-Git-Tag: v1.5.3-rc0~118^2~5 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/71a9db534a6bb4a6e9824c01b557a96ccaae0e89?hp=a1388cf0361b133deaba5266211a34bdec66b7cc Merge branch 'maint' * maint: git-gui: Allow as few as 0 lines of diff context --- diff --git a/git-gui.sh b/git-gui.sh index f87c12ea88..3bd12d20b5 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2071,17 +2071,17 @@ lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] $ctxm add separator $ctxm add command \ -label {Show Less Context} \ - -command {if {$repo_config(gui.diffcontext) >= 2} { + -command {if {$repo_config(gui.diffcontext) >= 1} { incr repo_config(gui.diffcontext) -1 reshow_diff }} lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] $ctxm add command \ -label {Show More Context} \ - -command { + -command {if {$repo_config(gui.diffcontext) < 99} { incr repo_config(gui.diffcontext) reshow_diff - } + }} lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] $ctxm add separator $ctxm add command -label {Options...} \ diff --git a/lib/diff.tcl b/lib/diff.tcl index 7e715a6865..29436b50cb 100644 --- a/lib/diff.tcl +++ b/lib/diff.tcl @@ -145,7 +145,7 @@ proc show_diff {path w {lno {}}} { lappend cmd -p lappend cmd --no-color - if {$repo_config(gui.diffcontext) > 0} { + if {$repo_config(gui.diffcontext) >= 0} { lappend cmd "-U$repo_config(gui.diffcontext)" } if {$w eq $ui_index} { diff --git a/lib/option.tcl b/lib/option.tcl index 4924b9aa56..ba2a723fce 100644 --- a/lib/option.tcl +++ b/lib/option.tcl @@ -188,7 +188,7 @@ proc do_options {} { {b gui.trustmtime {Trust File Modification Timestamps}} {b gui.pruneduringfetch {Prune Tracking Branches During Fetch}} - {i-1..99 gui.diffcontext {Number of Diff Context Lines}} + {i-0..99 gui.diffcontext {Number of Diff Context Lines}} {t gui.newbranchtemplate {New Branch Name Template}} } { set type [lindex $option 0]