on main help sign in
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.

commit505283a22e75b2e6420ae90777527f23c834347a authorAyman Bagabas <ayman.bagabas@gmail.com> dateFri 23 Jan 2026, 09:56 (9 months ago) parent6ba301e
1 file changed+3
internal/ui/model/ui.go+3
internal/ui/model/ui.go+3
@@ -1479,6 +1479,9 @@ func (m *UI) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
14791479 case key.Matches(msg, m.keyMap.Editor.Newline):
14801480 m.textarea.InsertRune('\n')
14811481 m.closeCompletions()
1482+ ta, cmd := m.textarea.Update(msg)
1483+ m.textarea = ta
1484+ cmds = append(cmds, cmd)
14821485 default:
14831486 if handleGlobalKeys(msg) {
14841487 // Handle global keys first before passing to textarea.