component

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeyMap = KeyMap{
	AcceptSuggestion: key.NewBinding(key.WithKeys("tab")),
	NextSuggestion:   key.NewBinding(key.WithKeys("down", "ctrl+n")),
	PrevSuggestion:   key.NewBinding(key.WithKeys("up", "ctrl+p")),
}

DefaultKeyMap is the default set of key bindings for navigating and acting upon the textinput.

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	AcceptSuggestion key.Binding
	NextSuggestion   key.Binding
	PrevSuggestion   key.Binding
}

KeyMap is the key bindings for different actions within the textinput.

type SuggestionTextInput

type SuggestionTextInput struct {
	KeyMap KeyMap
	// contains filtered or unexported fields
}

func NewSuggestionTextInput

func NewSuggestionTextInput(userCache map[string]func(...string) string) *SuggestionTextInput

NewSuggestionTextInput creates a new model with default settings.

func (*SuggestionTextInput) Blur

func (s *SuggestionTextInput) Blur()

func (*SuggestionTextInput) Focus

func (s *SuggestionTextInput) Focus()

func (*SuggestionTextInput) SetSuggestions

func (s *SuggestionTextInput) SetSuggestions(suggestions []string)

func (*SuggestionTextInput) SetValue

func (s *SuggestionTextInput) SetValue(val string)

func (*SuggestionTextInput) SetWidth

func (s *SuggestionTextInput) SetWidth(width int)

func (*SuggestionTextInput) Update

func (*SuggestionTextInput) Value

func (s *SuggestionTextInput) Value() string

func (*SuggestionTextInput) View

func (s *SuggestionTextInput) View() string

Jump to

Keyboard shortcuts

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