From d0d9ea56b9fcb8f2638269b1a6856ef14db7d694 Mon Sep 17 00:00:00 2001 From: ludovicm67 Date: Wed, 28 Aug 2019 20:32:35 +0200 Subject: termui: add colors for labels --- termui/show_bug.go | 5 +++-- termui/termui.go | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'termui') 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 { diff --git a/termui/termui.go b/termui/termui.go index 5d3bb0c1..8aece020 100644 --- a/termui/termui.go +++ b/termui/termui.go @@ -66,11 +66,12 @@ func Run(cache *cache.RepoCache) error { return err } + return nil } func initGui(action func(ui *termUI) error) { - g, err := gocui.NewGui(gocui.OutputNormal) + g, err := gocui.NewGui(gocui.Output256) if err != nil { ui.gError <- err -- cgit