Documentation
¶
Index ¶
- type Field
- func (m *Field) Backspace()
- func (m *Field) Cursor() int
- func (m *Field) End()
- func (m *Field) Home()
- func (m *Field) Insert(r rune)
- func (m *Field) InsertNL()
- func (m *Field) Left()
- func (m *Field) Right()
- func (m *Field) Set(value string)
- func (m *Field) String() string
- func (m *Field) Strings() []string
- type FieldWithFocus
- type FocusState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field represents a text field containing a string value, a newline representation, and a cursor position.
func (*Field) Backspace ¶
func (m *Field) Backspace()
Backspace deletes the character to the left of the cursor, if possible, and moves the cursor left.
func (*Field) Home ¶
func (m *Field) Home()
Home moves the cursor to the beginning of the Field value.
func (*Field) Insert ¶
Insert inserts the given rune at the cursor position and moves the cursor right.
func (*Field) InsertNL ¶ added in v0.1.5
func (m *Field) InsertNL()
InsertNL inserts a newline at the cursor position and moves the cursor right.
func (*Field) Left ¶
func (m *Field) Left()
Left moves the cursor one character to the left, if possible.
func (*Field) Right ¶
func (m *Field) Right()
Right moves the cursor one character to the right, if possible.
func (*Field) Set ¶
Set updates the value of the Field and resets the cursor to the end of the new value.
type FieldWithFocus ¶
type FieldWithFocus struct { *Field *FocusState }
func WithFocus ¶
func WithFocus(field *Field) *FieldWithFocus
type FocusState ¶
type FocusState struct {
// contains filtered or unexported fields
}
func (*FocusState) Blur ¶
func (m *FocusState) Blur()
func (*FocusState) Focus ¶
func (m *FocusState) Focus()
func (*FocusState) Focused ¶
func (m *FocusState) Focused() bool