on main help sign in
chore: fix editor
commitd4b530653675b809ad5839c0a2c297f323a7799a authorKujtim Hoxha <kujtimii.h@gmail.com> dateFri 25 Jul 2025, 17:13 (1 year ago) parentef28817
2 files changed+7−3
internal/tui/components/chat/editor/editor.go+3−3 internal/tui/page/chat/chat.go+4
internal/tui/components/chat/editor/editor.go+3−3
@@ -80,7 +80,7 @@ const (
8080 maxAttachments = 5
8181)
8282
83−type openEditorMsg struct {
83+type OpenEditorMsg struct {
8484 Text string
8585}
8686
@@ -119,7 +119,7 @@ func (m *editorCmp) openEditor(value string) tea.Cmd {
119119 return util.ReportWarn("Message is empty")
120120 }
121121 os.Remove(tmpfile.Name())
122− return openEditorMsg{
122+ return OpenEditorMsg{
123123 Text: strings.TrimSpace(string(content)),
124124 }
125125 })
@@ -204,7 +204,7 @@ func (m *editorCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
204204 m.completionsStartIndex = 0
205205 }
206206 }
207− case openEditorMsg:
207+ case OpenEditorMsg:
208208 m.textarea.SetValue(msg.Text)
209209 m.textarea.MoveToEnd()
210210 case tea.KeyPressMsg:
internal/tui/page/chat/chat.go+4
@@ -179,6 +179,10 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
179179 case CancelTimerExpiredMsg:
180180 p.isCanceling = false
181181 return p, nil
182+ case editor.OpenEditorMsg:
183+ u, cmd := p.editor.Update(msg)
184+ p.editor = u.(editor.Editor)
185+ return p, cmd
182186 case chat.SendMsg:
183187 return p, p.sendMessage(msg.Text, msg.Attachments)
184188 case chat.SessionSelectedMsg: