on main help sign in
fix(ui): rework cursor can appear out of place on multi-line (#1948)
505283aAyman Bagabas
internal/ui/model/ui.go+3
@@ -1479,6 +1479,9 @@ func (m *UI) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
1479 case key.Matches(msg, m.keyMap.Editor.Newline):
1479 case key.Matches(msg, m.keyMap.Editor.Newline):
1480 m.textarea.InsertRune('\n')
1480 m.textarea.InsertRune('\n')
1481 m.closeCompletions()
1481 m.closeCompletions()
1482+ ta, cmd := m.textarea.Update(msg)
1483+ m.textarea = ta
1484+ cmds = append(cmds, cmd)
1482 default:
1485 default:
1483 if handleGlobalKeys(msg) {
1486 if handleGlobalKeys(msg) {
1484 // Handle global keys first before passing to textarea.
1487 // Handle global keys first before passing to textarea.