Documentation ¶
Index ¶
- Variables
- type Formatters
- type Model
- func (m *Model[T]) Blur()
- func (m Model[T]) CompletableTokenBeforeCursor() string
- func (m Model[T]) CurrentToken() input.Token
- func (m Model[T]) CurrentTokenBeforeCursor() string
- func (m Model[T]) CurrentTokenRoundDown() input.Token
- func (m Model[T]) CursorIndex() int
- func (m Model[T]) CursorOffset() int
- func (m Model[T]) Error() error
- func (m Model[T]) FindLast(filter func(token input.Token, symbol string) bool) *input.Token
- func (m *Model[T]) Focus() tea.Cmd
- func (m Model[T]) Focused() bool
- func (m Model[T]) FormatText(text string) string
- func (m Model[T]) Formatters() Formatters
- func (m Model[T]) IsDelimiterToken(token input.Token) bool
- func (m *Model[T]) OnExecutorFinished()
- func (m *Model[T]) OnSuggestionChanged(suggestion suggestion.Suggestion[T])
- func (m *Model[T]) OnSuggestionUnselected()
- func (m *Model[T]) OnUpdateFinish(msg tea.Msg, suggestion *suggestion.Suggestion[T], isSelected bool) tea.Cmd
- func (m *Model[T]) OnUpdateStart(msg tea.Msg) tea.Cmd
- func (m Model[T]) PreviousToken() *input.Token
- func (m Model[T]) Prompt() string
- func (m *Model[T]) ResetValue()
- func (m Model[T]) Runes() []rune
- func (m *Model[T]) SetCursor(cursor int)
- func (m *Model[T]) SetCursorMode(cursorMode cursor.Mode) tea.Cmd
- func (m *Model[T]) SetFormatters(formatters Formatters)
- func (m *Model[T]) SetPrompt(prompt string)
- func (m *Model[T]) SetValue(value string)
- func (m Model[T]) ShouldClearSuggestions(prevText []rune, msg tea.KeyMsg) bool
- func (m Model[T]) ShouldSelectSuggestion(suggestion suggestion.Suggestion[T]) bool
- func (m Model[T]) ShouldUnselectSuggestion(prevText []rune, msg tea.KeyMsg) bool
- func (m Model[T]) SuggestionRunes(runes []rune) []rune
- func (m Model[T]) TokenValues() []string
- func (m Model[T]) Tokens() []input.Token
- func (m Model[T]) TokensBeforeCursor() []input.Token
- func (m Model[T]) Value() string
- func (m Model[T]) View(viewMode input.ViewMode) string
- type Option
- func WithCursorMode[T any](cursorMode cursor.Mode) Option[T]
- func WithDelimiterTokens[T any](tokens ...string) Option[T]
- func WithDelimiters[T any](delimiters ...string) Option[T]
- func WithFormatters[T any](formatters Formatters) Option[T]
- func WithPrompt[T any](prompt string) Option[T]
- func WithTokenFormatter[T any](formatter parser.Formatter) Option[T]
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultCurrentPlaceholderSuggestion = "240"
Functions ¶
This section is empty.
Types ¶
type Formatters ¶
type Formatters struct { // Placeholder handles styling for placeholder that's shown as the user types the current argument. Placeholder lipgloss.Style // Cursor handles styling for the cursor. Cursor lipgloss.Style }
Formatters handles styling for the input.
func DefaultFormatters ¶
func DefaultFormatters() Formatters
DefaultFormatters initializes the Formatters with sensible defaults. You can modify any settings that you wish after calling this function.
type Model ¶
type Model[T any] struct { // contains filtered or unexported fields }
func (Model[T]) CompletableTokenBeforeCursor ¶
func (Model[T]) CurrentToken ¶
func (Model[T]) CurrentTokenBeforeCursor ¶
func (Model[T]) CurrentTokenRoundDown ¶
func (Model[T]) CursorIndex ¶
func (Model[T]) CursorOffset ¶
func (Model[T]) FormatText ¶
func (Model[T]) Formatters ¶
func (m Model[T]) Formatters() Formatters
Formatters returns the formatters used by the input.
func (*Model[T]) OnExecutorFinished ¶
func (m *Model[T]) OnExecutorFinished()
func (*Model[T]) OnSuggestionChanged ¶
func (m *Model[T]) OnSuggestionChanged(suggestion suggestion.Suggestion[T])
func (*Model[T]) OnSuggestionUnselected ¶
func (m *Model[T]) OnSuggestionUnselected()
func (*Model[T]) OnUpdateFinish ¶
func (m *Model[T]) OnUpdateFinish( msg tea.Msg, suggestion *suggestion.Suggestion[T], isSelected bool, ) tea.Cmd
func (Model[T]) PreviousToken ¶
func (*Model[T]) ResetValue ¶
func (m *Model[T]) ResetValue()
func (*Model[T]) SetFormatters ¶
func (m *Model[T]) SetFormatters(formatters Formatters)
func (Model[T]) ShouldClearSuggestions ¶
func (Model[T]) ShouldSelectSuggestion ¶
func (m Model[T]) ShouldSelectSuggestion(suggestion suggestion.Suggestion[T]) bool
func (Model[T]) ShouldUnselectSuggestion ¶
func (Model[T]) SuggestionRunes ¶
func (Model[T]) TokenValues ¶
func (Model[T]) TokensBeforeCursor ¶
type Option ¶
func WithDelimiterTokens ¶
func WithDelimiters ¶
func WithFormatters ¶
func WithFormatters[T any](formatters Formatters) Option[T]
func WithPrompt ¶
Click to show internal directories.
Click to hide internal directories.