fuzzy

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KEYWORD_TEXT   = janet.Keyword("text")
	KEYWORD_NODE   = janet.Keyword("node")
	KEYWORD_REPLAY = janet.Keyword("replay")
)

Functions

func NewFuzzy

func NewFuzzy(
	ctx context.Context,
	options []Option,
	settings ...Setting,
) *taro.Program

func WithReverse added in v0.1.6

func WithReverse(ctx context.Context, f *Fuzzy)

func WithSticky added in v0.1.6

func WithSticky(ctx context.Context, f *Fuzzy)

Don't allow Fuzzy to quit.

Types

type AttachEvent added in v0.1.5

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

type DetachEvent added in v0.1.5

type DetachEvent struct {
}

type Fuzzy

type Fuzzy struct {
	util.Lifetime
	// contains filtered or unexported fields
}

func (*Fuzzy) Attach added in v0.1.5

func (f *Fuzzy) Attach(id tree.NodeID) taro.Cmd

func (*Fuzzy) Init added in v0.1.1

func (f *Fuzzy) Init() taro.Cmd

func (*Fuzzy) Update added in v0.1.1

func (f *Fuzzy) Update(msg tea.Msg) (taro.Model, tea.Cmd)

func (*Fuzzy) View added in v0.1.1

func (f *Fuzzy) View(state *tty.State)

type Match

type Match struct {
	Score int
	Index *[]int
}

type Option

type Option struct {
	Text string
	// Supported types:
	// - string: will be passed to a blank terminal
	// - NodeID: will show in the background
	Preview interface{}
	Chars   *util.Chars
	Match   *Match
	Result  interface{}
}

func Filter

func Filter(options []Option, search string) []Option

func NewOption added in v0.1.6

func NewOption(text string, result interface{}) Option

func UnmarshalOptions

func UnmarshalOptions(input *janet.Value) (result []Option, err error)

type SelectedEvent added in v0.1.6

type SelectedEvent struct {
	Option Option
}

type Setting added in v0.1.6

type Setting func(context.Context, *Fuzzy)

func WithAnimation added in v0.1.6

func WithAnimation(image image.Image) Setting

func WithInline added in v0.1.6

func WithInline(location geom.Vec2) Setting

Displays Fuzzy as a small window at this location on the screen.

func WithNodes added in v0.1.6

func WithNodes(t *tree.Tree, client *server.Client) Setting

If both of these are provided, Fuzzy can show previews for panes.

func WithPrompt added in v0.1.6

func WithPrompt(prompt string) Setting

func WithResult added in v0.1.6

func WithResult(result chan<- interface{}) Setting

Directories

Path Synopsis
fzf

Jump to

Keyboard shortcuts

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