func (h *history) Navigate(offset int) string {
	h.index += offset
	return h.Current()
}
Navigate navigates the history and returns that history item.
package multibar
import (
	"github.com/ambientsound/visp/log"
)
type history struct {
	items   []string
	current string
	index   int
}
func NewHistory() *history {
	return &history{
		items: make([]string, 0),
	}
}
func (h *history) Add(s string) {
	if len(s) > 0 {
		hl := len(h.items)
		if hl == 0 || h.items[hl-1] != s {
			h.items = append(h.items, s)
		}
	}
	h.Reset(s)
}
func (h *history) Reset(s string) {
	h.index = len(h.items)
	h.current = s
}
func (h *history) Current() string {
	if len(h.items) == 0 || h.index >= len(h.items) {
		log.Debugf("multibar: want index %d, returning current string '%s'", h.index, h.current)
		h.index = len(h.items)
		return h.current
	}
	h.validateIndex()
	log.Debugf("multibar: history returning index %d", h.index)
	return h.items[h.index]
}