From 505283a22e75b2e6420ae90777527f23c834347a Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Fri, 23 Jan 2026 09:56:51 -0500 Subject: [PATCH] fix(ui): rework cursor can appear out of place on multi-line (#1948) Ensure we update the textarea after inserting a newline to keep the cursor position accurate. --- internal/ui/model/ui.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/ui/model/ui.go b/internal/ui/model/ui.go index a104168c58422d01363850976ab68f1f99d90137..8bdb9bbf5dc34653597d3d6d8ad0a92b1cfdba7c 100644 --- a/internal/ui/model/ui.go +++ b/internal/ui/model/ui.go @@ -1479,6 +1479,9 @@ func (m *UI) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd { case key.Matches(msg, m.keyMap.Editor.Newline): m.textarea.InsertRune('\n') m.closeCompletions() + ta, cmd := m.textarea.Update(msg) + m.textarea = ta + cmds = append(cmds, cmd) default: if handleGlobalKeys(msg) { // Handle global keys first before passing to textarea.