From 6698acd8cecd81ae7f6cfbd9bc26153d4e7f8b88 Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Tue, 2 Oct 2018 16:18:39 -0600 Subject: [PATCH] make changes --- termui/show_bug.go | 13 ++++++++----- 1 file 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 } }