aboutsummaryrefslogtreecommitdiffstats
path: root/termui/show_bug.go
diff options
context:
space:
mode:
authorludovicm67 <ludovicmuller1@gmail.com>2019-08-28 20:32:35 +0200
committerludovicm67 <ludovicmuller1@gmail.com>2019-10-15 20:42:27 +0200
commitd0d9ea56b9fcb8f2638269b1a6856ef14db7d694 (patch)
treeef23378e16f1d4a7fbda9b1ad3c95c8b9d95dd2f /termui/show_bug.go
parent95b9bc94ff30ffe907e87f50bfcc9ea8b5680c61 (diff)
downloadgit-bug-d0d9ea56b9fcb8f2638269b1a6856ef14db7d694.tar.gz
termui: add colors for labels
Diffstat (limited to 'termui/show_bug.go')
-rw-r--r--termui/show_bug.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/termui/show_bug.go b/termui/show_bug.go
index 228b85b0..82d4160e 100644
--- a/termui/show_bug.go
+++ b/termui/show_bug.go
@@ -429,13 +429,14 @@ func (sb *showBug) renderSidebar(g *gocui.Gui, sideView *gocui.View) error {
labelStr := make([]string, len(snap.Labels))
for i, l := range snap.Labels {
- labelStr[i] = string(l)
+ color256 := l.Term256()
+ labelStr[i] = fmt.Sprintf("\x1b[38;5;%dm◼\x1b[0m %s", color256, string(l))
}
labels := strings.Join(labelStr, "\n")
labels, lines := text.WrapLeftPadded(labels, maxX, 2)
- content := fmt.Sprintf("%s\n\n%s", colors.Bold("Labels"), labels)
+ content := fmt.Sprintf("%s\n\n%s", colors.Bold(" Labels"), labels)
v, err := sb.createSideView(g, "sideLabels", x0, y0, maxX, lines+2)
if err != nil {