on main help sign in
fix(ui): simplify suffix handling in message editor
commit01c052473d7c9e95dc7391c188ed8deb34ad3b95 authorAyman Bagabas <ayman.bagabas@gmail.com> dateThu 8 Jan 2026, 10:52 (9 months ago) parent0c8cd47
1 file changed+2−2
internal/ui/model/ui.go+2−2
internal/ui/model/ui.go+2−2
@@ -813,9 +813,9 @@ func (m *UI) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
813813 switch {
814814 case key.Matches(msg, m.keyMap.Editor.SendMessage):
815815 value := m.textarea.Value()
816− if strings.HasSuffix(value, "\\") {
816+ if before, ok := strings.CutSuffix(value, "\\"); ok {
817817 // If the last character is a backslash, remove it and add a newline.
818− m.textarea.SetValue(strings.TrimSuffix(value, "\\"))
818+ m.textarea.SetValue(before)
819819 break
820820 }
821821