You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
413 B

package ui
import "github.com/rivo/tview"
func listNext(l *tview.List) (loadOlder bool) {
ni := l.GetCurrentItem() + 1
if ni >= l.GetItemCount() {
ni = l.GetItemCount() - 1
if ni < 0 {
ni = 0
}
}
l.SetCurrentItem(ni)
return l.GetItemCount()-(ni+1) < 5
}
func listPrev(l *tview.List) (loadNewer bool) {
ni := l.GetCurrentItem() - 1
if ni < 0 {
ni = 0
}
l.SetCurrentItem(ni)
return ni < 4
}