apparently making a function public

This commit is contained in:
hems
2025-07-26 17:24:09 +01:00
parent 5dac761f9e
commit e87b41e56c
2 changed files with 6 additions and 8 deletions

View File

@@ -37,7 +37,7 @@ type Editor interface {
SetSession(session session.Session) tea.Cmd
IsCompletionsOpen() bool
Cursor() *tea.Cursor
SendMessage() tea.Cmd
Send() tea.Cmd
}
type FileCompletionItem struct {
@@ -130,7 +130,7 @@ func (m *editorCmp) Init() tea.Cmd {
return nil
}
func (m *editorCmp) send() tea.Cmd {
func (m *editorCmp) Send() tea.Cmd {
if m.app.CoderAgent == nil {
return util.ReportError(fmt.Errorf("coder agent is not initialized"))
}
@@ -267,7 +267,7 @@ func (m *editorCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.textarea.SetValue(value[:len(value)-1])
} else {
// Otherwise, send the message
return m, m.send()
return m, m.Send()
}
}
}
@@ -443,9 +443,7 @@ func (c *editorCmp) IsCompletionsOpen() bool {
return c.isCompletionsOpen
}
func (c *editorCmp) SendMessage() tea.Cmd {
return c.send()
}
func New(app *app.App, initialPrompt string) Editor {
t := styles.CurrentTheme()

View File

@@ -165,7 +165,7 @@ func (p *chatPage) Init() tea.Cmd {
// If we have an initial prompt, automatically send it
if p.initialPrompt != "" {
cmds = append(cmds, p.editor.SendMessage())
cmds = append(cmds, p.editor.Send())
}
}
@@ -295,7 +295,7 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// If we have an initial prompt, automatically send it after onboarding completes
if p.initialPrompt != "" {
return p, tea.Batch(p.SetSize(p.width, p.height), p.editor.SendMessage())
return p, tea.Batch(p.SetSize(p.width, p.height), p.editor.Send())
}
return p, p.SetSize(p.width, p.height)