mirror of
https://github.com/wavetermdev/inshellisense.git
synced 2026-08-05 13:43:30 -07:00
fix: reset the selected completion index to 0 to prevent the selected… (#173)
* fix: reset the selected completion index to 0 to prevent the selected state from not being correctly initialized when the completion toggle. * style: fix lint Signed-off-by: Chapman Pendery <cpendery@microsoft.com> --------- Signed-off-by: Chapman Pendery <cpendery@microsoft.com> Co-authored-by: Chapman Pendery <cpendery@microsoft.com>
This commit is contained in:
co-authored by
Chapman Pendery
parent
8fc1d03a5f
commit
ddd79c5949
@@ -87,7 +87,10 @@ export class SuggestionManager {
|
||||
|
||||
async render(remainingLines: number): Promise<SuggestionsSequence> {
|
||||
await this._loadSuggestions();
|
||||
if (!this.#suggestBlob) return { data: "", rows: 0 };
|
||||
if (!this.#suggestBlob) {
|
||||
this.#activeSuggestionIdx = 0;
|
||||
return { data: "", rows: 0 };
|
||||
}
|
||||
const { suggestions, argumentDescription } = this.#suggestBlob;
|
||||
|
||||
const page = Math.min(Math.floor(this.#activeSuggestionIdx / maxSuggestions) + 1, Math.floor(suggestions.length / maxSuggestions) + 1);
|
||||
|
||||
Reference in New Issue
Block a user