Merge branch 'maint'
authorShawn O. Pearce <spearce@spearce.org>
Fri, 1 Jun 2007 03:34:24 +0000 (23:34 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 1 Jun 2007 03:34:24 +0000 (23:34 -0400)
* maint:
git-gui: Allow as few as 0 lines of diff context

git-gui.sh
lib/diff.tcl
lib/option.tcl
index f87c12ea88a5a45a7a152afa462c690d454c51eb..3bd12d20b5f787a2b5119b3a2f1eebbd310a50c1 100755 (executable)
@@ -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...} \
index 7e715a6865858e35babf30e624c16314cdc2c2ec..29436b50cb351f88b1ebde20620729f210c37933 100644 (file)
@@ -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} {
index 4924b9aa56ce70c67331b515b8b508aeb241b6f8..ba2a723fce1b1cef8f4fc166e60e842e63c9842d 100644 (file)
@@ -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]