Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions packages/tui/internal/components/chat/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,12 @@ func (m *editorComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, nil
}

updated, cmd := m.Clear()
m = updated.(*editorComponent)
cmds = append(cmds, cmd)
// Find the last '/' and replace from there to cursor
slashIndex := m.textarea.LastRuneIndex('/')
if slashIndex != -1 {
cursorCol := m.textarea.CursorColumn()
m.textarea.ReplaceRange(slashIndex, cursorCol, "")
}

commandName := strings.TrimPrefix(msg.Item.Value, "/")
cmds = append(cmds, util.CmdHandler(commands.ExecuteCommandMsg(m.app.Commands[commands.CommandName(commandName)])))
Expand Down
1 change: 0 additions & 1 deletion packages/tui/internal/tui/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ func (a Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// 3. Handle completions trigger
if keyString == "/" &&
!a.showCompletionDialog &&
a.editor.Value() == "" &&
!a.app.IsBashMode {
a.showCompletionDialog = true

Expand Down