termui: fix left/right unnecessarely moving up/down

This commit is contained in:
Michael Muré 2018-08-17 13:07:46 +02:00
parent 90f235b393
commit c93c0221ca
No known key found for this signature in database
GPG Key ID: A4457C029293126F

View File

@ -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 {