wip: append-prompt is better
This commit is contained in:
parent
5aafab118f
commit
500cea5ce7
1 changed files with 6 additions and 1 deletions
|
|
@ -515,7 +515,12 @@ func (a Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
Parts []opencode.Part `json:"parts"`
|
Parts []opencode.Part `json:"parts"`
|
||||||
}
|
}
|
||||||
json.Unmarshal((msg.Body), &body)
|
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:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue