aboutsummaryrefslogtreecommitdiffstats
path: root/termui/show_bug.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-13 12:43:47 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-13 12:43:47 +0200
commitfb0f5530f100e8ae3b8561fe5dcfd19edc181b15 (patch)
tree1e7a3d63d4d02e4dab56a0ee58aae5317401e706 /termui/show_bug.go
parentf569e6aacc0690e7b1bebf33a10a8e0d154937df (diff)
downloadgit-bug-fb0f5530f100e8ae3b8561fe5dcfd19edc181b15.tar.gz
catch a lot of error not being checked
Diffstat (limited to 'termui/show_bug.go')
-rw-r--r--termui/show_bug.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/termui/show_bug.go b/termui/show_bug.go
index eb112674..d2e4fc09 100644
--- a/termui/show_bug.go
+++ b/termui/show_bug.go
@@ -422,7 +422,10 @@ func (sb *showBug) saveAndBack(g *gocui.Gui, v *gocui.View) error {
if err != nil {
return err
}
- ui.activateWindow(ui.bugTable)
+ err = ui.activateWindow(ui.bugTable)
+ if err != nil {
+ return err
+ }
return nil
}
@@ -468,8 +471,6 @@ func (sb *showBug) scrollDown(g *gocui.Gui, v *gocui.View) error {
}
func (sb *showBug) selectPrevious(g *gocui.Gui, v *gocui.View) error {
- defer sb.focusView(g)
-
var selectable []string
if sb.isOnSide {
selectable = sb.sideSelectableView
@@ -485,7 +486,7 @@ func (sb *showBug) selectPrevious(g *gocui.Gui, v *gocui.View) error {
}
sb.selected = selectable[maxInt(i-1, 0)]
- return nil
+ return sb.focusView(g)
}
}
@@ -493,12 +494,10 @@ func (sb *showBug) selectPrevious(g *gocui.Gui, v *gocui.View) error {
sb.selected = selectable[0]
}
- return nil
+ return sb.focusView(g)
}
func (sb *showBug) selectNext(g *gocui.Gui, v *gocui.View) error {
- defer sb.focusView(g)
-
var selectable []string
if sb.isOnSide {
selectable = sb.sideSelectableView
@@ -509,7 +508,7 @@ func (sb *showBug) selectNext(g *gocui.Gui, v *gocui.View) error {
for i, name := range selectable {
if name == sb.selected {
sb.selected = selectable[minInt(i+1, len(selectable)-1)]
- return nil
+ return sb.focusView(g)
}
}
@@ -517,7 +516,7 @@ func (sb *showBug) selectNext(g *gocui.Gui, v *gocui.View) error {
sb.selected = selectable[0]
}
- return nil
+ return sb.focusView(g)
}
func (sb *showBug) left(g *gocui.Gui, v *gocui.View) error {