Documentation
¶
Overview ¶
Package filefinder is a fuzzy picker modal over a list of items, bound to F.
Index ¶
- type Model
- func (m *Model) GetSelected() any
- func (m *Model) Hide()
- func (m *Model) IsVisible() bool
- func (m *Model) Query() string
- func (m *Model) SelectNext()
- func (m *Model) SelectPrev()
- func (m *Model) SetQuery(query string)
- func (m *Model) Show(items []string, data []any)
- func (m *Model) View(width, _ int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the picker's state. The item and data slices are parallel, so a caller passing lists of different lengths gets matches whose Original is missing.
func (*Model) GetSelected ¶
GetSelected returns the data value paired with the highlighted match, or nil when nothing matches.
func (*Model) Hide ¶
func (m *Model) Hide()
Hide closes the picker, keeping the items so a reopen without Show still has them.
func (*Model) IsVisible ¶
IsVisible reports whether the picker is open, which is how the parent decides to route keys here.
func (*Model) SelectNext ¶
func (m *Model) SelectNext()
SelectNext moves the cursor down one match, wrapping past the last.
func (*Model) SelectPrev ¶
func (m *Model) SelectPrev()
SelectPrev moves the cursor up one match, wrapping past the first.
func (*Model) SetQuery ¶
SetQuery re-runs the fuzzy match and resets the cursor to the top match. It ignores the query when Show was never called, so the cursor also stays put.