mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
fix: command being passed as arg when no args present (#2553)
This commit is contained in:
parent
84f0c63fa1
commit
4614e4983e
1 changed files with 4 additions and 1 deletions
|
|
@ -507,7 +507,10 @@ func (m *editorComponent) Submit() (tea.Model, tea.Cmd) {
|
|||
commandName := strings.Split(expandedValue, " ")[0]
|
||||
command := m.app.Commands[commands.CommandName(commandName)]
|
||||
if command.Custom {
|
||||
args := strings.TrimPrefix(expandedValue, command.PrimaryTrigger()+" ")
|
||||
args := ""
|
||||
if strings.HasPrefix(expandedValue, command.PrimaryTrigger()+" ") {
|
||||
args = strings.TrimPrefix(expandedValue, command.PrimaryTrigger()+" ")
|
||||
}
|
||||
cmds = append(
|
||||
cmds,
|
||||
util.CmdHandler(app.SendCommand{Command: string(command.Name), Args: args}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue