@@ -312,7 +312,7 @@ proc getcommit {id} {
312
312
313
313
proc readrefs {} {
314
314
global tagids idtags headids idheads tagcontents
315
- global otherrefids idotherrefs
315
+ global otherrefids idotherrefs mainhead
316
316
317
317
foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
318
318
catch {unset $v }
@@ -358,6 +358,13 @@ proc readrefs {} {
358
358
}
359
359
}
360
360
close $refd
361
+ set mainhead {}
362
+ catch {
363
+ set thehead [exec git symbolic-ref HEAD]
364
+ if {[string match " refs/heads/*" $thehead ]} {
365
+ set mainhead [string range $thehead 11 end]
366
+ }
367
+ }
361
368
}
362
369
363
370
proc show_error {w top msg} {
@@ -3150,9 +3157,9 @@ proc bindline {t id} {
3150
3157
}
3151
3158
3152
3159
proc drawtags {id x xt y1} {
3153
- global idtags idheads idotherrefs
3160
+ global idtags idheads idotherrefs mainhead
3154
3161
global linespc lthickness
3155
- global canv mainfont commitrow rowtextx curview fgcolor
3162
+ global canv mainfont commitrow rowtextx curview fgcolor bgcolor
3156
3163
3157
3164
set marks {}
3158
3165
set ntags 0
@@ -3177,8 +3184,14 @@ proc drawtags {id x xt y1} {
3177
3184
set yb [expr {$yt + $linespc - 1}]
3178
3185
set xvals {}
3179
3186
set wvals {}
3187
+ set i -1
3180
3188
foreach tag $marks {
3181
- set wid [font measure $mainfont $tag ]
3189
+ incr i
3190
+ if {$i >= $ntags && $i < $ntags + $nheads && $tag eq $mainhead } {
3191
+ set wid [font measure [concat $mainfont bold] $tag ]
3192
+ } else {
3193
+ set wid [font measure $mainfont $tag ]
3194
+ }
3182
3195
lappend xvals $xt
3183
3196
lappend wvals $wid
3184
3197
set xt [expr {$xt + $delta + $wid + $lthickness + $linespc }]
@@ -3189,6 +3202,7 @@ proc drawtags {id x xt y1} {
3189
3202
foreach tag $marks x $xvals wid $wvals {
3190
3203
set xl [expr {$x + $delta }]
3191
3204
set xr [expr {$x + $delta + $wid + $lthickness }]
3205
+ set font $mainfont
3192
3206
if {[incr ntags -1] >= 0} {
3193
3207
# draw a tag
3194
3208
set t [$canv create polygon $x [expr {$yt + $delta }] $xl $yt \
@@ -3200,6 +3214,9 @@ proc drawtags {id x xt y1} {
3200
3214
# draw a head or other ref
3201
3215
if {[incr nheads -1] >= 0} {
3202
3216
set col green
3217
+ if {$tag eq $mainhead } {
3218
+ lappend font bold
3219
+ }
3203
3220
} else {
3204
3221
set col " #ddddff"
3205
3222
}
@@ -3216,7 +3233,7 @@ proc drawtags {id x xt y1} {
3216
3233
}
3217
3234
}
3218
3235
set t [$canv create text $xl $y1 -anchor w -text $tag -fill $fgcolor \
3219
- -font $mainfont -tags [list tag.$id text]]
3236
+ -font $font -tags [list tag.$id text]]
3220
3237
if {$ntags >= 0} {
3221
3238
$canv bind $t <1> [list showtag $tag 1]
3222
3239
}
0 commit comments