diff options
author | Michael Muré <batolettre@gmail.com> | 2020-04-12 11:11:01 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-08-22 15:12:09 +0200 |
commit | 9ce84fc1a310e04ab63661f5fc3963a9de317981 (patch) | |
tree | 1a73a919d61ca742a3748140a0d040bfe10c5220 /termui/show_bug.go | |
parent | 88c28db99851e7f5cceed6544759d37ac87a34d4 (diff) | |
download | git-bug-9ce84fc1a310e04ab63661f5fc3963a9de317981.tar.gz |
termui: make the help visually easier to parse
Diffstat (limited to 'termui/show_bug.go')
-rw-r--r-- | termui/show_bug.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/termui/show_bug.go b/termui/show_bug.go index 23b82c73..74eccd36 100644 --- a/termui/show_bug.go +++ b/termui/show_bug.go @@ -21,6 +21,15 @@ const showBugHeaderView = "showBugHeaderView" const timeLayout = "Jan 2 2006" +var showBugHelp = helpBar{ + {"q", "Save and return"}, + {"←↓↑→,hjkl", "Navigation"}, + {"o", "Toggle open/close"}, + {"e", "Edit"}, + {"c", "Comment"}, + {"t", "Change title"}, +} + type showBug struct { cache *cache.RepoCache bug *cache.BugCache @@ -93,11 +102,10 @@ func (sb *showBug) layout(g *gocui.Gui) error { sb.childViews = append(sb.childViews, showBugInstructionView) v.Frame = false v.FgColor = gocui.ColorWhite - v.BgColor = gocui.ColorBlue } v.Clear() - _, _ = fmt.Fprintf(v, "[q] Save and return [←↓↑→,hjkl] Navigation [o] Toggle open/close [e] Edit [c] Comment [t] Change title") + _, _ = fmt.Fprint(v, showBugHelp.Render()) _, err = g.SetViewOnTop(showBugInstructionView) if err != nil { |