mirror of
https://github.com/sst/opencode.git
synced 2025-07-22 23:35:01 +00:00
fix: \{return} should be replaced with new line on all lines (#1119)
This commit is contained in:
parent
9964d8e6c0
commit
46c246e01f
1 changed files with 2 additions and 1 deletions
|
@ -297,7 +297,8 @@ func (m *editorComponent) Submit() (tea.Model, tea.Cmd) {
|
||||||
|
|
||||||
if len(value) > 0 && value[len(value)-1] == '\\' {
|
if len(value) > 0 && value[len(value)-1] == '\\' {
|
||||||
// If the last character is a backslash, remove it and add a newline
|
// 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")
|
m.textarea.InsertString("\n")
|
||||||
return m, nil
|
return m, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue