summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYihui Khuu <[email protected]>2025-07-18 21:22:36 +1000
committerGitHub <[email protected]>2025-07-18 06:22:36 -0500
commit46c246e01f6c61d9b01556ffcaefac6b18e47d66 (patch)
tree83f3fe9e56ba089ea82239cdac590d0d47f12f76
parent9964d8e6c0e21b921838b2ee6c681a8933e4b8e6 (diff)
downloadopencode-46c246e01f6c61d9b01556ffcaefac6b18e47d66.tar.gz
opencode-46c246e01f6c61d9b01556ffcaefac6b18e47d66.zip
fix: \{return} should be replaced with new line on all lines (#1119)
-rw-r--r--packages/tui/internal/components/chat/editor.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/tui/internal/components/chat/editor.go b/packages/tui/internal/components/chat/editor.go
index 085d1e9df..3db6fa80f 100644
--- a/packages/tui/internal/components/chat/editor.go
+++ b/packages/tui/internal/components/chat/editor.go
@@ -297,7 +297,8 @@ func (m *editorComponent) Submit() (tea.Model, tea.Cmd) {
if len(value) > 0 && value[len(value)-1] == '\\' {
// If the last character is a backslash, remove it and add a newline
- m.textarea.ReplaceRange(len(value)-1, len(value), "")
+ backslashCol := m.textarea.CurrentRowLength() - 1
+ m.textarea.ReplaceRange(backslashCol, backslashCol+1, "")
m.textarea.InsertString("\n")
return m, nil
}