aboutsummaryrefslogtreecommitdiffstats
path: root/termui/bug_table.go
diff options
context:
space:
mode:
authorludovicm67 <ludovicmuller1@gmail.com>2019-10-16 23:51:11 +0200
committerludovicm67 <ludovicmuller1@gmail.com>2019-10-16 23:51:11 +0200
commitc9e824152d3d32a654e54bb7e9939f19b6b835ac (patch)
tree57d09e32a0e6d1266038cc50c0cc6528ccccca49 /termui/bug_table.go
parent209d337bbd2ca0b6d8535917dff9de77196938ae (diff)
downloadgit-bug-c9e824152d3d32a654e54bb7e9939f19b6b835ac.tar.gz
termui: better overflow management
Diffstat (limited to 'termui/bug_table.go')
-rw-r--r--termui/bug_table.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/termui/bug_table.go b/termui/bug_table.go
index 01269df8..236aa17d 100644
--- a/termui/bug_table.go
+++ b/termui/bug_table.go
@@ -291,17 +291,21 @@ func (bt *bugTable) render(v *gocui.View, maxX int) {
for _, excerpt := range bt.excerpts {
summaryTxt := fmt.Sprintf("%4d 💬", excerpt.LenComments)
- labelsTxt := "" // fmt.Sprintf("L:%-2d", len(excerpt.Labels))
+ if excerpt.LenComments > 9999 {
+ summaryTxt = " ∞ 💬"
+ }
+ labelsTxt := ""
nbLabels := 0
for _, l := range excerpt.Labels {
lc := l.Color()
lc256 := lc.Term256()
- labelsTxt += lc256.Escape() + " ◼" + lc256.Unescape()
nbLabels++
- if nbLabels >= 5 {
+ if nbLabels >= 5 && len(excerpt.Labels) > 5 {
+ labelsTxt += " …"
break
}
+ labelsTxt += lc256.Escape() + " ◼" + lc256.Unescape()
}
var authorDisplayName string