From d957ab849b362babbc8ccb82139a9c48734fe3d3 Mon Sep 17 00:00:00 2001 From: adamdotdevin <2363879+adamdottv@users.noreply.github.com> Date: Mon, 21 Jul 2025 10:43:55 -0500 Subject: fix(tui): up/down arrow handling --- packages/tui/internal/components/textarea/textarea.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'packages/tui/internal/components/textarea') diff --git a/packages/tui/internal/components/textarea/textarea.go b/packages/tui/internal/components/textarea/textarea.go index d97b8fdc7..60e72e09a 100644 --- a/packages/tui/internal/components/textarea/textarea.go +++ b/packages/tui/internal/components/textarea/textarea.go @@ -1430,14 +1430,14 @@ func (m Model) Width() int { return m.width } -// moveToBegin moves the cursor to the beginning of the input. -func (m *Model) moveToBegin() { +// MoveToBegin moves the cursor to the beginning of the input. +func (m *Model) MoveToBegin() { m.row = 0 m.SetCursorColumn(0) } -// moveToEnd moves the cursor to the end of the input. -func (m *Model) moveToEnd() { +// MoveToEnd moves the cursor to the end of the input. +func (m *Model) MoveToEnd() { m.row = len(m.value) - 1 m.SetCursorColumn(len(m.value[m.row])) } @@ -1626,9 +1626,9 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) { case key.Matches(msg, m.KeyMap.WordBackward): m.wordLeft() case key.Matches(msg, m.KeyMap.InputBegin): - m.moveToBegin() + m.MoveToBegin() case key.Matches(msg, m.KeyMap.InputEnd): - m.moveToEnd() + m.MoveToEnd() case key.Matches(msg, m.KeyMap.LowercaseWordForward): m.lowercaseRight() case key.Matches(msg, m.KeyMap.UppercaseWordForward): -- cgit v1.2.3