fzfwrapper

package module
v2.0.0-...-4dd6b5a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ByScore    criterion = iota // sort by score
	ByLength                    // sort by string length
	ByPosition                  // sort by match location

)

Variables

This section is empty.

Functions

func MergeOffsets

func MergeOffsets(matchOffsets []fzf.Offset) []fzf.Offset

Types

type ByOrder

type ByOrder []fzf.Offset

ByOrder is for sorting substring offsets

func (ByOrder) Len

func (a ByOrder) Len() int

func (ByOrder) Less

func (a ByOrder) Less(i, j int) bool

func (ByOrder) Swap

func (a ByOrder) Swap(i, j int)

type ByRelevance

type ByRelevance []Result

ByRelevance is for sorting Items

func (ByRelevance) Len

func (a ByRelevance) Len() int

func (ByRelevance) Less

func (a ByRelevance) Less(i, j int) bool

func (ByRelevance) Swap

func (a ByRelevance) Swap(i, j int)

type ByRelevanceTac

type ByRelevanceTac []Result

ByRelevanceTac is for sorting Items

func (ByRelevanceTac) Len

func (a ByRelevanceTac) Len() int

func (ByRelevanceTac) Less

func (a ByRelevanceTac) Less(i, j int) bool

func (ByRelevanceTac) Swap

func (a ByRelevanceTac) Swap(i, j int)

type Chunk

type Chunk struct {
	// contains filtered or unexported fields
}

type InputData

type InputData interface {
	FzfInputList() []string
	FzfInputLen() int
}

type Item

type Item struct {
	// contains filtered or unexported fields
}

func (*Item) AsString

func (item *Item) AsString(stripAnsi bool) string

AsString returns the original string

func (*Item) Index

func (item *Item) Index() int32

func (*Item) TrimLength

func (item *Item) TrimLength() uint16

type ItemBuilder

type ItemBuilder func(*Item, []byte) bool

type Option

type Option func(opt *opt)

func WithSortBy

func WithSortBy(c ...criterion) Option

type Pattern

type Pattern struct {
	// contains filtered or unexported fields
}

func NewPattern

func NewPattern(chunk *Chunk, pattern [][]rune, sortBy []criterion) *Pattern

func (Pattern) MatchChunk

func (p Pattern) MatchChunk() []Result

func (Pattern) MatchItem

func (p Pattern) MatchItem(item *Item) (*Result, []fzf.Offset, *[]int)

type Result

type Result struct {
	Item    *Item
	Points  [4]int
	Offsets []fzf.Offset
	Pos     *[]int
}

func (*Result) HighlightResult

func (r *Result) HighlightResult() string

type Token

type Token struct {
	// contains filtered or unexported fields
}

type Wrapper

type Wrapper struct {
	// contains filtered or unexported fields
}

func NewWrapper

func NewWrapper(options ...Option) *Wrapper

func (*Wrapper) Fuzzy

func (w *Wrapper) Fuzzy() ([]Result, error)

func (*Wrapper) SetInput

func (w *Wrapper) SetInput(input InputData)

func (*Wrapper) SetPattern

func (w *Wrapper) SetPattern(pattern string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL