Thread (13 messages) flat view 13 messages, 4 authors, 2016-11-09
STALE3582d

[PATCH GITK 1/6] gitk: Internal: drawtags: Abolish "singletag" variable

From: Ian Jackson <hidden>
Date: 2016-11-08 00:53:19
Subsystem: the rest · Maintainer: Linus Torvalds

We are going to want to make the contents of `marks' somewhat more
complicated in a moment, so it won't be possible to use what is
effectively a single variable to represent the status of the whole of
the non-heads part of the marks list.

Luckily the strings that replace actual tag names, in the `singletag'
case, are not themselves valid tag names.  So they can be detected
directly.

(Also, `singletag' was not quite right anyway: really it meant that
the tag name(s) had been abbreviated.)

No functional change.

Signed-off-by: Ian Jackson <redacted>
---
 gitk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gitk b/gitk
index 805a1c7..42fa41a 100755
--- a/gitk
+++ b/gitk
@@ -6570,7 +6570,6 @@ proc drawtags {id x xt y1} {
 	if {$ntags > $maxtags ||
 	    [totalwidth $marks mainfont $extra] > $maxwidth} {
 	    # show just a single "n tags..." tag
-	    set singletag 1
 	    if {$ntags == 1} {
 		set marks [list "tag..."]
 	    } else {
@@ -6620,7 +6619,7 @@ proc drawtags {id x xt y1} {
 		       $xr $yt $xr $yb $xl $yb $x [expr {$yb - $delta}] \
 		       -width 1 -outline $tagoutlinecolor -fill $tagbgcolor \
 		       -tags tag.$id]
-	    if {$singletag} {
+	    if {[regexp {^tag\.\.\.|^\d+ } $tag]} {
 		set tagclick [list showtags $id 1]
 	    } else {
 		set tagclick [list showtag $tag_quoted 1]
-- 
2.10.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help