diff --git a/textinput/textinput.go b/textinput/textinput.go index 9645fa7f..85c5ecf1 100644 --- a/textinput/textinput.go +++ b/textinput/textinput.go @@ -61,7 +61,6 @@ type Model struct { // General settings. Prompt string Placeholder string - Cursor string BlinkSpeed time.Duration EchoMode EchoMode EchoCharacter rune @@ -150,6 +149,11 @@ func (m Model) Value() string { return string(m.value) } +// Cursor returns the cursor position. +func (m Model) Cursor() int { + return m.pos +} + // SetCursor moves the cursor to the given position. If the position is // out of bounds the cursor will be moved to the start or end accordingly. func (m *Model) SetCursor(pos int) {