func (l *List) SetStart(i int) {
	if i < 0 {
		i = 0
	}
	if i > l.cursor {
		l.start = l.cursor
	} else {
		l.start = i
	}
}
SetStart sets the current scroll position. Values out of bounds will be
clamped.
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) Start() int {
	return l.start
}