diff --git a/termui/bug_table.go b/termui/bug_table.go index 1545dbc914f09980be36a2386e3e8f37d295916c..cb3f6964a84710e635dff0a0aacb4c2586d94bde 100644 --- a/termui/bug_table.go +++ b/termui/bug_table.go @@ -340,8 +340,13 @@ func (bt *bugTable) renderFooter(v *gocui.View, maxX int) { func (bt *bugTable) cursorDown(g *gocui.Gui, v *gocui.View) error { _, y := v.Cursor() - y = minInt(y+1, bt.getTableLength()-1) + // If we are at the bottom of the page, switch to the next one. + if y+1 > bt.getTableLength()-1 { + return bt.nextPage(g, v) + } + + y = minInt(y+1, bt.getTableLength()-1) // window is too small to set the cursor properly, ignoring the error _ = v.SetCursor(0, y) bt.selectCursor = y @@ -351,8 +356,13 @@ func (bt *bugTable) cursorDown(g *gocui.Gui, v *gocui.View) error { func (bt *bugTable) cursorUp(g *gocui.Gui, v *gocui.View) error { _, y := v.Cursor() - y = maxInt(y-1, 0) + // If we are at the top of the page, switch to the previous one. + if y-1 < 0 { + return bt.previousPage(g, v) + } + + y = maxInt(y-1, 0) // window is too small to set the cursor properly, ignoring the error _ = v.SetCursor(0, y) bt.selectCursor = y