Skip to content

Commit 500cea5

Browse files
committed
wip: append-prompt is better
1 parent 5aafab1 commit 500cea5

File tree

1 file changed

+6
-1
lines changed
  • packages/tui/internal/tui

1 file changed

+6
-1
lines changed

packages/tui/internal/tui/tui.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,12 @@ func (a Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
515515
Parts []opencode.Part `json:"parts"`
516516
}
517517
json.Unmarshal((msg.Body), &body)
518-
a.editor.SetValueWithAttachments(strings.TrimRight(a.editor.Value(), " ") + " " + body.Text + " ")
518+
existing := a.editor.Value()
519+
text := body.Text
520+
if existing != "" && !strings.HasSuffix(existing, " ") {
521+
text = " " + text
522+
}
523+
a.editor.SetValueWithAttachments(existing + text + " ")
519524
default:
520525
break
521526
}

0 commit comments

Comments
 (0)