From ae99f46cec66f45862c2d953bb1af31efdc4f073 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Fri, 9 Jan 2026 08:28:49 -0300 Subject: [PATCH] feat(v2/textarea): expose Column(), clarify 0-indexing (#875) Signed-off-by: Carlos Alexandro Becker --- textarea/textarea.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/textarea/textarea.go b/textarea/textarea.go index fbe2b5e..7e4508a 100644 --- a/textarea/textarea.go +++ b/textarea/textarea.go @@ -595,11 +595,16 @@ func (m *Model) LineCount() int { return len(m.value) } -// Line returns the row position of the cursor. +// Line returns the 0-indexed row position of the cursor. func (m Model) Line() int { return m.row } +// Column returns the 0-indexed column position of the cursor. +func (m Model) Column() int { + return m.col +} + // ScrollYOffset returns the Y offset (top row) index of the current view, which // can be used to calculate the current scroll position. func (m Model) ScrollYOffset() int {