func (t *TabComplete) next() string {
	if t.cursor >= t.Len() {
		t.cursor = 0
	}
	s := t.base + t.items[t.cursor]
	t.cursor++
	return s
}
next returns the next tabcomplete item in the list.
package tabcomplete
import (
	"fmt"
	"strings"
	"github.com/ambientsound/visp/api"
	"github.com/ambientsound/visp/commands"
	"github.com/ambientsound/visp/input/lexer"
	"github.com/ambientsound/visp/parser"
	"github.com/ambientsound/visp/utils"
)
type TabComplete struct {
	api      api.API
	base     string    
	cursor   int       
	items    []string  
	original string    
	source   string    
}
func New(source string, a api.API) *TabComplete {
	return &TabComplete{
		api:    a,
		source: source,
	}
}
func (t *TabComplete) Len() int {
	return len(t.items)
}
func (t *TabComplete) Active() bool {
	return t.Len() > 0
}
func (t *TabComplete) Scan() (string, error) {
	if !t.Active() {
		if err := t.init(); err != nil {
			return "", err
		}
	}
	return t.next(), nil
}