@@ -41,6 +41,7 @@ type Editor interface {
41 SetSession(session session.Session) tea.Cmd
41 SetSession(session session.Session) tea.Cmd
42 IsCompletionsOpen() bool
42 IsCompletionsOpen() bool
43 HasAttachments() bool
43 HasAttachments() bool
44 Cursor() *tea.Cursor
45 Cursor() *tea.Cursor
@@ -261,7 +262,7 @@ func (m *editorCmp) Update(msg tea.Msg) (util.Model, tea.Cmd) {
261 curIdx := m.textarea.Width()*cur.Y + cur.X
262 curIdx := m.textarea.Width()*cur.Y + cur.X
263 // Open command palette when "/" is pressed on empty prompt
264 // Open command palette when "/" is pressed on empty prompt
264− case msg.String() == "/" && len(strings.TrimSpace(m.textarea.Value())) == 0:
265+ case msg.String() == "/" && m.IsEmpty():
265 return m, util.CmdHandler(dialogs.OpenDialogMsg{
266 return m, util.CmdHandler(dialogs.OpenDialogMsg{
266 Model: commands.NewCommandDialog(m.session.ID),
267 Model: commands.NewCommandDialog(m.session.ID),
@@ -542,6 +543,10 @@ func (c *editorCmp) HasAttachments() bool {
542 return len(c.attachments) > 0
543 return len(c.attachments) > 0
546+func (c *editorCmp) IsEmpty() bool {
547+ return strings.TrimSpace(c.textarea.Value()) == ""
545func normalPromptFunc(info textarea.PromptInfo) string {
550func normalPromptFunc(info textarea.PromptInfo) string {
546 t := styles.CurrentTheme()
551 t := styles.CurrentTheme()
547 if info.LineNumber == 0 {
552 if info.LineNumber == 0 {