When completing a /gsd subcommand via autocomplete (e.g. selecting 'auto' after typing '/gsd '), ENTER now submits immediately instead of requiring a second press. The selectConfirm handler already fell through to submit when the autocomplete prefix started with '/' (completing the command name itself). Now it also falls through when the cursor is in a slash command context (completing an argument like 'auto', 'status', 'help'). Non-slash completions (@file references, paths) still require explicit ENTER to submit — only slash command arguments auto-submit.
This commit is contained in:
parent
614012f38a
commit
188e7a67c4
1 changed files with 3 additions and 1 deletions
|
|
@ -559,7 +559,9 @@ export class Editor implements Component, Focusable {
|
|||
this.state.cursorLine = result.cursorLine;
|
||||
this.setCursorCol(result.cursorCol);
|
||||
|
||||
if (this.autocompletePrefix.startsWith("/")) {
|
||||
if (this.autocompletePrefix.startsWith("/") || this.isInSlashCommandContext(
|
||||
(this.state.lines[this.state.cursorLine] || "").slice(0, this.state.cursorCol),
|
||||
)) {
|
||||
this.cancelAutocomplete();
|
||||
// Fall through to submit
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue