diff --git a/internal/tui/components/chat/editor/editor.go b/internal/tui/components/chat/editor/editor.go index 952dfda51f2423b891f0bacce8fea7f788249deb..a061cc44d355a2ff69d9cde4176861ca2c85a889 100644 --- a/internal/tui/components/chat/editor/editor.go +++ b/internal/tui/components/chat/editor/editor.go @@ -187,6 +187,7 @@ func (m *editorCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } case openEditorMsg: m.textarea.SetValue(msg.Text) + m.textarea.MoveToEnd() case tea.KeyPressMsg: switch { // Completions @@ -389,11 +390,11 @@ func NewEditorCmp(app *app.App) util.Model { t := styles.CurrentTheme() ta := textarea.New() ta.SetStyles(t.S().TextArea) - ta.SetPromptFunc(4, func(lineIndex int, focused bool) string { - if lineIndex == 0 { + ta.SetPromptFunc(4, func(info textarea.PromptInfo) string { + if info.LineNumber == 0 { return " > " } - if focused { + if info.Focused { return t.S().Base.Foreground(t.GreenDark).Render("::: ") } else { return t.S().Muted.Render("::: ")