autocomplete

package
v0.0.0-...-9947234 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

func New

func New(rootCmd *cobra.Command, parent modelid.ID) Model

func (Model) Accept

func (m Model) Accept() string

Accept returns the currently selected suggestion, or an empty string

func (Model) AutoComplete

func (m Model) AutoComplete(input string, cursorPosition int) tea.Cmd

AutoComplete returns a command that will start the auto-complete process

func (Model) Clear

func (m Model) Clear() tea.Cmd

Clear clears the suggestions

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) NextColumn

func (m Model) NextColumn() tea.Cmd

NextColumn returns a command that will select the next option

func (Model) NextResult

func (m Model) NextResult() tea.Cmd

NextResult returns a command that will select the next option

func (Model) NextRow

func (m Model) NextRow() tea.Cmd

NextRow returns a command that will select the next option

func (Model) PreviousColumn

func (m Model) PreviousColumn() tea.Cmd

PreviousColumn returns a command that will select the previous option

func (Model) PreviousResult

func (m Model) PreviousResult() tea.Cmd

PreviousResult returns a command that will select the previous option

func (Model) PreviousRow

func (m Model) PreviousRow() tea.Cmd

PreviousRow returns a command that will select the previous option

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type Option

type Option struct {
	Name        string
	Description string
}

type SingleAutoCompleteOptionMsg

type SingleAutoCompleteOptionMsg struct {
	ID modelid.ID
}

SingleAutoCompleteOptionMsg is a message that is sent by the autocomplete model to indicate only one option has been found and should just be accepted

func (SingleAutoCompleteOptionMsg) ForModelID

func (msg SingleAutoCompleteOptionMsg) ForModelID() modelid.ID

Jump to

Keyboard shortcuts

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