gitk: Improve display of list of nearby tags and heads

This provides a control in the preferences pane for the limit on how many tags or heads are displayed with the commit details under the Branch(es), Precedes and Follows headings. This limit is now saved in ~/.gitk so that changes are persistent. This also applies word-wrapping to the list of tags or heads under the Branch, Precedes and Follows headings, so that long lists are more readable. Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras committed Jan 1, 2013 at 23:08 UTC d34835c939bbe059e347133b357441e21a7f7840
1 file changed +9 -3
gitk
+9 -3
@@ -2375,6 +2375,7 @@ proc makewindow {} {
2375 $ctext tag conf msep -font textfontbold
2376 $ctext tag conf found -back yellow
2377 $ctext tag conf currentsearchhit -back orange
2378 + $ctext tag conf wwrap -wrap word
2379
2380 .pwbottom add .bleft
2381 if {!$use_ttk} {
@@ -2721,7 +2722,7 @@ proc savestuff {w} {
2722 global cmitmode wrapcomment datetimeformat limitdiffs
2723 global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor
2724 global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk
2724 - global hideremotes want_ttk
2725 + global hideremotes want_ttk maxrefs
2726
2727 if {$stuffsaved} return
2728 if {![winfo viewable .]} return
@@ -2743,6 +2744,7 @@ proc savestuff {w} {
2744 puts $f [list set autoselect $autoselect]
2745 puts $f [list set autosellen $autosellen]
2746 puts $f [list set showneartags $showneartags]
2747 + puts $f [list set maxrefs $maxrefs]
2748 puts $f [list set hideremotes $hideremotes]
2749 puts $f [list set showlocalchanges $showlocalchanges]
2750 puts $f [list set datetimeformat $datetimeformat]
@@ -6906,6 +6908,7 @@ proc appendrefs {pos ids var} {
6908 set sep ", "
6909 }
6910 }
6911 + $ctext tag add wwrap "$pos linestart" "$pos lineend"
6912 $ctext conf -state disabled
6913 return [llength $tags]
6914 }
@@ -10937,7 +10940,7 @@ proc create_prefs_page {w} {
10940 proc prefspage_general {notebook} {
10941 global NS maxwidth maxgraphpct showneartags showlocalchanges
10942 global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
10940 - global hideremotes want_ttk have_ttk
10943 + global hideremotes want_ttk have_ttk maxrefs
10944
10945 set page [create_prefs_page $notebook.general]
10946
@@ -10966,9 +10969,12 @@ proc prefspage_general {notebook} {
10969 ${NS}::label $page.tabstopl -text [mc "Tab spacing"]
10970 spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
10971 grid x $page.tabstopl $page.tabstop -sticky w
10969 - ${NS}::checkbutton $page.ntag -text [mc "Display nearby tags"] \
10972 + ${NS}::checkbutton $page.ntag -text [mc "Display nearby tags/heads"] \
10973 -variable showneartags
10974 grid x $page.ntag -sticky w
10975 + ${NS}::label $page.maxrefsl -text [mc "Maximum # tags/heads to show"]
10976 + spinbox $page.maxrefs -from 1 -to 1000 -width 4 -textvariable maxrefs
10977 + grid x $page.maxrefsl $page.maxrefs -sticky w
10978 ${NS}::checkbutton $page.ldiff -text [mc "Limit diffs to listed paths"] \
10979 -variable limitdiffs
10980 grid x $page.ldiff -sticky w