diff options
author | Michael Muré <batolettre@gmail.com> | 2018-08-17 13:07:46 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-08-17 13:07:46 +0200 |
commit | c93c0221ca64483e257d0efeb37248e09e73ade7 (patch) | |
tree | fa37e942b02355e29491b2a9243b64d2adab3856 /termui/show_bug.go | |
parent | 90f235b393b2f7b387d9f3749e486dec1a381f96 (diff) | |
download | git-bug-c93c0221ca64483e257d0efeb37248e09e73ade7.tar.gz |
termui: fix left/right unnecessarely moving up/down
Diffstat (limited to 'termui/show_bug.go')
-rw-r--r-- | termui/show_bug.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/termui/show_bug.go b/termui/show_bug.go index f4f1294f..12cb6cf4 100644 --- a/termui/show_bug.go +++ b/termui/show_bug.go @@ -523,18 +523,28 @@ func (sb *showBug) left(g *gocui.Gui, v *gocui.View) error { if sb.isOnSide { sb.isOnSide = false sb.selected = "" + return sb.selectNext(g, v) } - return sb.selectNext(g, v) + if sb.selected == "" { + return sb.selectNext(g, v) + } + + return nil } func (sb *showBug) right(g *gocui.Gui, v *gocui.View) error { if !sb.isOnSide { sb.isOnSide = true sb.selected = "" + return sb.selectNext(g, v) } - return sb.selectNext(g, v) + if sb.selected == "" { + return sb.selectNext(g, v) + } + + return nil } func (sb *showBug) focusView(g *gocui.Gui) error { |