Documentation
¶
Index ¶
- type CompletionPrompt
- func (cp *CompletionPrompt) Clear() *CompletionPrompt
- func (cp *CompletionPrompt) Draw(screen tcell.Screen)
- func (cp *CompletionPrompt) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (cp *CompletionPrompt) SetHintColor(color tcell.Color) *CompletionPrompt
- func (cp *CompletionPrompt) SetLabel(label string) *CompletionPrompt
- func (cp *CompletionPrompt) SetSubmitHandler(handler func(text string)) *CompletionPrompt
- type EditSelectList
- func (esl *EditSelectList) Clear() *EditSelectList
- func (esl *EditSelectList) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (esl *EditSelectList) MoveToNext()
- func (esl *EditSelectList) MoveToPrevious()
- func (esl *EditSelectList) SetInitialValue(value string) *EditSelectList
- func (esl *EditSelectList) SetLabel(label string) *EditSelectList
- func (esl *EditSelectList) SetSubmitHandler(handler func(text string)) *EditSelectList
- func (esl *EditSelectList) SetText(text string) *EditSelectList
- type IntEditSelect
- func (ies *IntEditSelect) Clear() *IntEditSelect
- func (ies *IntEditSelect) GetValue() int
- func (ies *IntEditSelect) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (ies *IntEditSelect) SetChangeHandler(handler func(value int)) *IntEditSelect
- func (ies *IntEditSelect) SetLabel(label string) *IntEditSelect
- func (ies *IntEditSelect) SetValue(value int) *IntEditSelect
- type WordList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompletionPrompt ¶
type CompletionPrompt struct {
*tview.InputField
// contains filtered or unexported fields
}
CompletionPrompt is an input field with auto-completion hints. When user input is a prefix of exactly one word from the word list, the component displays a greyed completion hint.
func NewCompletionPrompt ¶
func NewCompletionPrompt(words []string) *CompletionPrompt
NewCompletionPrompt creates a new completion prompt with the given word list.
func (*CompletionPrompt) Clear ¶
func (cp *CompletionPrompt) Clear() *CompletionPrompt
Clear clears the input text and hint.
func (*CompletionPrompt) Draw ¶
func (cp *CompletionPrompt) Draw(screen tcell.Screen)
Draw renders the input field and the completion hint.
func (*CompletionPrompt) InputHandler ¶
func (cp *CompletionPrompt) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
InputHandler handles keyboard input for the completion prompt.
func (*CompletionPrompt) SetHintColor ¶
func (cp *CompletionPrompt) SetHintColor(color tcell.Color) *CompletionPrompt
SetHintColor sets the color for the completion hint text.
func (*CompletionPrompt) SetLabel ¶
func (cp *CompletionPrompt) SetLabel(label string) *CompletionPrompt
SetLabel sets the label displayed before the input field.
func (*CompletionPrompt) SetSubmitHandler ¶
func (cp *CompletionPrompt) SetSubmitHandler(handler func(text string)) *CompletionPrompt
SetSubmitHandler sets the callback for when Enter is pressed. Only the user-typed text is passed to the callback (hint is ignored).
type EditSelectList ¶
type EditSelectList struct {
*tview.InputField
// contains filtered or unexported fields
}
EditSelectList is a one-line input field that allows both: 1. Free-form text entry (if allowTyping is true) 2. Arrow key navigation through a predefined list of values
When the user presses up/down arrow keys, the previous/next value from the configured list is selected. If allowTyping is true, the user can also type any value; if false, only arrow keys work. The submit handler is called immediately on every change (typing or arrow navigation).
func NewEditSelectList ¶
func NewEditSelectList(values []string, allowTyping bool) *EditSelectList
NewEditSelectList creates a new edit/select list with the given values. If allowTyping is true, users can type freely; if false, only arrow keys work.
func (*EditSelectList) Clear ¶
func (esl *EditSelectList) Clear() *EditSelectList
Clear clears the input text and resets the index.
func (*EditSelectList) InputHandler ¶
func (esl *EditSelectList) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
InputHandler handles keyboard input for the edit/select list.
func (*EditSelectList) MoveToNext ¶
func (esl *EditSelectList) MoveToNext()
MoveToNext cycles to the next value in the list.
func (*EditSelectList) MoveToPrevious ¶
func (esl *EditSelectList) MoveToPrevious()
MoveToPrevious cycles to the previous value in the list.
func (*EditSelectList) SetInitialValue ¶
func (esl *EditSelectList) SetInitialValue(value string) *EditSelectList
SetInitialValue sets the text to one of the predefined values. If the value is found in the list, the index is set accordingly.
func (*EditSelectList) SetLabel ¶
func (esl *EditSelectList) SetLabel(label string) *EditSelectList
SetLabel sets the label displayed before the input field.
func (*EditSelectList) SetSubmitHandler ¶
func (esl *EditSelectList) SetSubmitHandler(handler func(text string)) *EditSelectList
SetSubmitHandler sets the callback for when Enter is pressed.
func (*EditSelectList) SetText ¶
func (esl *EditSelectList) SetText(text string) *EditSelectList
SetText sets the current text and resets the index to -1 (free-form mode).
type IntEditSelect ¶
type IntEditSelect struct {
*tview.InputField
// contains filtered or unexported fields
}
IntEditSelect is a one-line input field for integer values within a range. It supports both: 1. Direct numeric typing with validation (if allowTyping is true) 2. Arrow key navigation to increment/decrement values
Arrow keys wrap around at boundaries (up at min goes to max, down at max goes to min). If allowTyping is false, only arrow keys work; typing is silently ignored. The change handler is called immediately on every valid change.
func NewIntEditSelect ¶
func NewIntEditSelect(min, max int, allowTyping bool) *IntEditSelect
NewIntEditSelect creates a new integer input field with the specified range [min, max]. The initial value is set to min. If allowTyping is true, users can type digits; if false, only arrow keys work.
func (*IntEditSelect) Clear ¶
func (ies *IntEditSelect) Clear() *IntEditSelect
Clear resets the value to the minimum value in the range.
func (*IntEditSelect) GetValue ¶
func (ies *IntEditSelect) GetValue() int
GetValue returns the current integer value.
func (*IntEditSelect) InputHandler ¶
func (ies *IntEditSelect) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
InputHandler handles keyboard input for the integer input field.
func (*IntEditSelect) SetChangeHandler ¶
func (ies *IntEditSelect) SetChangeHandler(handler func(value int)) *IntEditSelect
SetChangeHandler sets the callback function that is called whenever the value changes.
func (*IntEditSelect) SetLabel ¶
func (ies *IntEditSelect) SetLabel(label string) *IntEditSelect
SetLabel sets the label displayed before the input field.
func (*IntEditSelect) SetValue ¶
func (ies *IntEditSelect) SetValue(value int) *IntEditSelect
SetValue sets the current value, clamping it to the valid range [min, max].
type WordList ¶
WordList displays a list of words space-separated with word wrapping. Words are never broken in the middle; wrapping occurs at word boundaries.
func NewWordList ¶
NewWordList creates a new WordList component.