mirror of
https://github.com/charmbracelet/crush.git
synced 2025-08-02 05:20:46 +03:00
apparently making a function public
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user