diff options
Diffstat (limited to 'termui/show_bug.go')
-rw-r--r-- | termui/show_bug.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/termui/show_bug.go b/termui/show_bug.go index 6a750456..4ca987bd 100644 --- a/termui/show_bug.go +++ b/termui/show_bug.go @@ -94,12 +94,12 @@ func (sb *showBug) layout(g *gocui.Gui) error { } v.Clear() - fmt.Fprintf(v, "[q] Save and return [←↓↑→,hjkl] Navigation [o] Toggle open/close ") + fmt.Fprintf(v, "[q] Save and return [←↓↑→,hjkl] Navigation ") if sb.isOnSide { fmt.Fprint(v, "[a] Add label [r] Remove label") } else { - fmt.Fprint(v, "[c] Comment [t] Change title") + fmt.Fprint(v, "[o] Toggle open/close [c] Comment [t] Change title") } _, err = g.SetViewOnTop(showBugInstructionView) @@ -610,10 +610,13 @@ func (sb *showBug) setTitle(g *gocui.Gui, v *gocui.View) error { } func (sb *showBug) toggleOpenClose(g *gocui.Gui, v *gocui.View) error { - if sb.bug.Snapshot().Status.String() == "open" { + switch sb.bug.Snapshot().Status { + case bug.OpenStatus: return sb.bug.Close() - } else { - return sb.bug.Open() + case bug.ClosedStatus: + return sb.bug.Open() + default: + return nil } } |