Documentation
¶
Index ¶
- Variables
- type FZF
- type FindOption
- type KeyMap
- type Option
- func WithCaseSensitive(s bool) Option
- func WithCountView(f func(itemsCount, matchesCount, windowWidth int) string) Option
- func WithCountViewEnabled(b bool) Option
- func WithCursor(c string) Option
- func WithHotReload(locker sync.Locker) Option
- func WithInputPlaceholder(p string) Option
- func WithKeyMap(km KeyMap) Option
- func WithLimit(l int) Option
- func WithNoLimit(n bool) Option
- func WithPrompt(p string) Option
- func WithSelectedPrefix(p string) Option
- func WithStyles(opts ...StylesOption) Option
- func WithUnselectedPrefix(p string) Option
- type Style
- type Styles
- type StylesOption
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAbort is returned when a Fuzzy Finder is aborted. ErrAbort = errors.New("abort") )
Functions ¶
This section is empty.
Types ¶
type FZF ¶
type FZF struct {
// contains filtered or unexported fields
}
Fuzzy Finder.
func (*FZF) Find ¶
func (fzf *FZF) Find(items interface{}, itemFunc func(i int) string, opts ...FindOption) ([]int, error)
Find launches the Fuzzy Finder and returns a list of indexes of the selected items.
func (*FZF) ForceReload ¶ added in v0.7.0
ForceReload forces the reload of items. HotReload must be enabled.
type FindOption ¶ added in v0.4.0
type FindOption func(o *findOption)
Option represents a option for the Find.
func WithItemPrefix ¶ added in v0.3.0
func WithItemPrefix(f func(i int) string) FindOption
WithItemPrefix sets the prefix function of the item.
type Option ¶
type Option func(o *option)
Option represents a option for the Fuzzy Finder.
func WithCaseSensitive ¶ added in v0.7.0
WithCaseSensitive sets the case sensitivity.
func WithCountView ¶ added in v0.5.0
WithCountView sets the function to create the count view.
func WithCountViewEnabled ¶ added in v0.5.0
WithCountViewEnabled enables or disables count view.
func WithHotReload ¶ added in v0.7.0
WithHotReload sets the locker for read items.
func WithInputPlaceholder ¶
WithInputPlaceholder sets the placeholder for input.
func WithNoLimit ¶
WithNoLimit can be set to `true` to allow unlimited item selection.
func WithSelectedPrefix ¶
WithSelectedPrefix sets the prefix of the selected item.
func WithUnselectedPrefix ¶
WithUnselectedPrefix sets the prefix of the unselected item.
type Style ¶
type Style struct {
ForegroundColor string
BackgroundColor string
Bold bool
Blink bool
Italic bool
Strikethrough bool
Underline bool
Faint bool
}
Style represents a style.
type Styles ¶
type Styles struct {
// contains filtered or unexported fields
}
Styles is the styles for each component.
type StylesOption ¶
type StylesOption func(o *stylesOption)
Option represents a option for the styles.
func WithStyleCursor ¶
func WithStyleCursor(s Style) StylesOption
WithStyleCursor sets the style of cursor.
func WithStyleCursorLine ¶
func WithStyleCursorLine(s Style) StylesOption
WithStyleCursorLine sets the style of cursor line.
func WithStyleMatches ¶
func WithStyleMatches(s Style) StylesOption
WithStyleMatches sets the style of the matched characters.
func WithStyleSelectedPrefix ¶
func WithStyleSelectedPrefix(s Style) StylesOption
WithStyleSelectedPrefix sets the style of prefix of the selected item.
func WithStyleUnselectedPrefix ¶
func WithStyleUnselectedPrefix(s Style) StylesOption
WithStyleUnselectedPrefix sets the style of prefix of the unselected item.

