Procházet zdrojové kódy

wip: append-prompt is better

Dax Raad před 1 rokem
rodič
revize
500cea5ce7
1 změnil soubory, kde provedl 6 přidání a 1 odebrání
  1. 6 1
      packages/tui/internal/tui/tui.go

+ 6 - 1
packages/tui/internal/tui/tui.go

@@ -515,7 +515,12 @@ func (a Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 				Parts []opencode.Part `json:"parts"`
 			}
 			json.Unmarshal((msg.Body), &body)
-			a.editor.SetValueWithAttachments(strings.TrimRight(a.editor.Value(), " ") + " " + body.Text + " ")
+			existing := a.editor.Value()
+			text := body.Text
+			if existing != "" && !strings.HasSuffix(existing, " ") {
+				text = " " + text
+			}
+			a.editor.SetValueWithAttachments(existing + text + " ")
 		default:
 			break
 		}