Skip to content

Commit a99e8d9

Browse files
authored
fix: don't add command to suggestion cache until suggestions complete loading (#358)
Signed-off-by: Chapman Pendery <[email protected]>
1 parent 7fad131 commit a99e8d9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/isterm/commandManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class CommandManager {
7676
const whitespace = " ".repeat(commandWhitespaceTerminationWidth);
7777
const whitespaceIdx = promptLineText.indexOf(whitespace);
7878
if (whitespaceIdx != -1) {
79-
this.#activeCommand.promptText = promptLineText.substring(0, whitespaceIdx);
79+
this.#activeCommand.promptText = promptLineText.substring(0, whitespaceIdx) + 1;
8080
this.#activeCommand.promptEndX = whitespaceIdx;
8181
}
8282
}

src/ui/suggestionManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export class SuggestionManager {
5757
if (commandText == this.#command) {
5858
return;
5959
}
60-
this.#command = commandText;
6160
const suggestionBlob = await getSuggestions(commandText, this.#term.cwd, this.#shell);
61+
this.#command = commandText;
6262
this.#suggestBlob = suggestionBlob;
6363
this.#activeSuggestionIdx = 0;
6464
}

0 commit comments

Comments
 (0)