Documentation
¶
Overview ¶
Package input provides Bubbles text inputs with independently blinking cursors.
Index ¶
- func Expose(previous, current Cursor) tea.Cmd
- type Area
- func (m *Area) CursorDown()
- func (m *Area) CursorUp()
- func (m *Area) InsertString(value string)
- func (m *Area) MoveToBegin()
- func (m *Area) MoveToEnd()
- func (m *Area) OnCursorChange(fn func())
- func (m *Area) Reset()
- func (m *Area) SetCursorColumn(col int)
- func (m *Area) SetStyles(style textarea.Styles)
- func (m *Area) SetValue(value string)
- func (m *Area) Update(msg tea.Msg) (Area, tea.Cmd)
- func (m *Area) WakeCursor()
- type BlinkMsg
- type Cursor
- type CursorOwner
- type Text
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Area ¶
Area is a multi-line text input with the same blink behavior as Text.
func NewArea ¶
func NewArea() Area
NewArea creates a multi-line input with the default Bubbles styling.
func (*Area) CursorDown ¶
func (m *Area) CursorDown()
func (*Area) InsertString ¶
func (*Area) MoveToBegin ¶
func (m *Area) MoveToBegin()
func (*Area) OnCursorChange ¶
func (m *Area) OnCursorChange(fn func())
OnCursorChange lets a cached parent invalidate its rendering.
func (*Area) SetCursorColumn ¶
func (*Area) WakeCursor ¶
func (m *Area) WakeCursor()
WakeCursor refreshes the caret when the owner handles input outside Update.
type BlinkMsg ¶
type BlinkMsg struct {
// contains filtered or unexported fields
}
BlinkMsg is an addressed cursor timer event. Only the input that scheduled it may apply it, and only while that input is still exposed.
type Cursor ¶
type Cursor interface {
Focused() bool
VirtualCursor() bool
SetVirtualCursor(enabled bool)
// contains filtered or unexported methods
}
Cursor is the visibility surface of an input. The parent chooses which focused input is exposed; the input controls the blink phase and timing.
type CursorOwner ¶
type CursorOwner interface {
CursorInput() Cursor
}
CursorOwner exposes the focused input of a component, if it has one.
type Text ¶
Text is a single-line text input. Bubbles handles editing and draws the virtual cursor, but its own blink mode is kept off: moving the cursor must not cancel or replace the independently scheduled timer event.
func NewText ¶
func NewText() Text
NewText creates a single-line input with the default Bubbles styling.
func (*Text) OnCursorChange ¶
func (m *Text) OnCursorChange(fn func())
OnCursorChange lets a cached parent invalidate its rendering.