Documentation
¶
Index ¶
- func Find(query string, content *Content) (string, error)
- func FindWithScreen(screen tcell.Screen, query string, content *Content) (string, error)
- type Content
- func (c *Content) Filter(query string)
- func (c *Content) GetCell(row, column int) *tview.TableCell
- func (c *Content) GetColumnCount() int
- func (c *Content) GetRowCount() int
- func (c *Content) SetHideLessThan(score float64)
- func (c *Content) SetReturnOneResult()
- func (c *Content) SetTextScorer(textScorer algo.TextScorer)
- func (c *Content) SetVerbose()
- type EnumerableValueStringer
- type InputItem
- type NopScorer
- type SortableInputItems
- type Str
- type StrList
- type StrMap
- type StrMapEntry
- type ValueStringer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Content ¶
type Content struct { tview.TableContentReadOnly // contains filtered or unexported fields }
Content holds the data for the fuzzy finder
func ReadNewContent ¶
ReadNewContent creates a new Content from new line separated input
func SupplyNewContent ¶
func SupplyNewContent(input EnumerableValueStringer) *Content
SupplyNewContent creates a new Content from a slice of ValueStringer types
func (*Content) Filter ¶
Filter processes InputItems, scores them with SmithWaterman Any items with score less than 1 are not shown Items are sorted by their score
func (*Content) GetColumnCount ¶
func (*Content) GetRowCount ¶
func (*Content) SetHideLessThan ¶
SetHideLessThan remove item from output with a lower score
func (*Content) SetReturnOneResult ¶
func (c *Content) SetReturnOneResult()
SetReturnOneResult returns the one result immediatly if a passed in query only matches one item
func (*Content) SetTextScorer ¶
func (c *Content) SetTextScorer(textScorer algo.TextScorer)
SetTextScorer sets the algorithm for scoring the query against the line
func (*Content) SetVerbose ¶
func (c *Content) SetVerbose()
SetVerbose outputs the scores along with the line. useful for debugging
type EnumerableValueStringer ¶
type EnumerableValueStringer interface {
Each(handler func(ValueStringer))
}
EnumerableValueStringer is iterable
type InputItem ¶
type InputItem struct { Score float64 // contains filtered or unexported fields }
InputItem is an item of ValueStringer with a Score
func NewInputItem ¶
func NewInputItem(item ValueStringer) InputItem
type SortableInputItems ¶
type SortableInputItems struct {
// contains filtered or unexported fields
}
SortableInputItems can be Sorted by their Score and difference in length of query
func (SortableInputItems) Len ¶
func (i SortableInputItems) Len() int
func (SortableInputItems) Less ¶
func (i SortableInputItems) Less(x, y int) bool
func (SortableInputItems) Swap ¶
func (i SortableInputItems) Swap(x, y int)
type StrList ¶
type StrList []string
StrList is a simple string slice
func NewStrList ¶
NewStrList is a utility fuction to convert a string slice
func (StrList) Each ¶
func (l StrList) Each(f func(ValueStringer))
Each allows iteration over the string slice
type StrMap ¶
StrMap uses the key as Value and value as String
func (StrMap) Each ¶
func (m StrMap) Each(f func(ValueStringer))
Each allows iteration over the string map
type StrMapEntry ¶
StrMapEntry implements ValueStringer
func (StrMapEntry) String ¶
func (s StrMapEntry) String() string
func (StrMapEntry) Value ¶
func (s StrMapEntry) Value() string
type ValueStringer ¶
type ValueStringer interface { // String used for searching String() string // Value returned to user via stdout Value() string }
ValueStringer has a value and a string output, potentially different