Skip to content

Commit d34835c

Browse files
committed
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 <[email protected]>
1 parent d809fb1 commit d34835c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

gitk

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,7 @@ proc makewindow {} {
23752375
$ctext tag conf msep -font textfontbold
23762376
$ctext tag conf found -back yellow
23772377
$ctext tag conf currentsearchhit -back orange
2378+
$ctext tag conf wwrap -wrap word
23782379

23792380
.pwbottom add .bleft
23802381
if {!$use_ttk} {
@@ -2721,7 +2722,7 @@ proc savestuff {w} {
27212722
global cmitmode wrapcomment datetimeformat limitdiffs
27222723
global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor
27232724
global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk
2724-
global hideremotes want_ttk
2725+
global hideremotes want_ttk maxrefs
27252726

27262727
if {$stuffsaved} return
27272728
if {![winfo viewable .]} return
@@ -2743,6 +2744,7 @@ proc savestuff {w} {
27432744
puts $f [list set autoselect $autoselect]
27442745
puts $f [list set autosellen $autosellen]
27452746
puts $f [list set showneartags $showneartags]
2747+
puts $f [list set maxrefs $maxrefs]
27462748
puts $f [list set hideremotes $hideremotes]
27472749
puts $f [list set showlocalchanges $showlocalchanges]
27482750
puts $f [list set datetimeformat $datetimeformat]
@@ -6906,6 +6908,7 @@ proc appendrefs {pos ids var} {
69066908
set sep ", "
69076909
}
69086910
}
6911+
$ctext tag add wwrap "$pos linestart" "$pos lineend"
69096912
$ctext conf -state disabled
69106913
return [llength $tags]
69116914
}
@@ -10937,7 +10940,7 @@ proc create_prefs_page {w} {
1093710940
proc prefspage_general {notebook} {
1093810941
global NS maxwidth maxgraphpct showneartags showlocalchanges
1093910942
global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
10940-
global hideremotes want_ttk have_ttk
10943+
global hideremotes want_ttk have_ttk maxrefs
1094110944

1094210945
set page [create_prefs_page $notebook.general]
1094310946

@@ -10966,9 +10969,12 @@ proc prefspage_general {notebook} {
1096610969
${NS}::label $page.tabstopl -text [mc "Tab spacing"]
1096710970
spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
1096810971
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"] \
1097010973
-variable showneartags
1097110974
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
1097210978
${NS}::checkbutton $page.ldiff -text [mc "Limit diffs to listed paths"] \
1097310979
-variable limitdiffs
1097410980
grid x $page.ldiff -sticky w

0 commit comments

Comments
 (0)