func (l *List) PageUp() {
	start := l.start - l.size
	if start < 0 {
		l.start = 0
	} else {
		l.start = start
	}
	cursor := l.start
	if cursor < l.cursor {
		l.cursor = cursor
	}
}
PageUp moves the visible list backward by x items. Where x is the size of the
visible items on the list. The selected item becomes the first visible item.
If the list is already at the bottom, the selected item becomes the last
visible item.
package list
import (
	"fmt"
	"reflect"
	"strings"
)
type Searcher func(input string, index int) bool
const NotFound = -1
type List struct {
	items    []*interface{}
	scope    []*interface{}
	cursor   int  
	size     int  
	start    int
	Searcher Searcher
}
func New(items interface{}, size int) (*List, error) {
	if size < 1 {
		return nil, fmt.Errorf("list size %d must be greater than 0", size)
	}
	if items == nil || reflect.TypeOf(items).Kind() != reflect.Slice {
		return nil, fmt.Errorf("items %v is not a slice", items)
	}
	slice := reflect.ValueOf(items)
	values := make([]*interface{}, slice.Len())
	for i := range values {
		item := slice.Index(i).Interface()
		values[i] = &item
	}
	return &List{size: size, items: values, scope: values}, nil
}
func (l *List) Prev() {
	if l.cursor > 0 {
		l.cursor--
	}
	if l.start > l.cursor {
		l.start = l.cursor
	}
}
func (l *List) Search(term string) {
	term = strings.Trim(term, " ")
	l.cursor = 0
	l.start = 0
	l.search(term)
}
func (l *List) CancelSearch() {
	l.cursor = 0
	l.start = 0
	l.scope = l.items
}
func (l *List) search(term string) {
	var scope []*interface{}
	for i, item := range l.items {
		if l.Searcher(term, i) {
			scope = append(scope, item)
		}
	}
	l.scope = scope
}
func (l *List) Next() {
	max := len(l.scope) - 1
	if l.cursor < max {
		l.cursor++
	}
	if l.start+l.size <= l.cursor {
		l.start = l.cursor - l.size + 1
	}
}