mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Hide terminal suggest when completions are no longer valid
Fixes #211190
This commit is contained in:
parent
aacda1dd2f
commit
20f31cbad3
|
@ -142,6 +142,13 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
|
|||
|
||||
this._currentPromptInputState = promptInputState;
|
||||
|
||||
// Hide the widget if the cursor moves to the left of the initial position as the
|
||||
// completions are no longer valid
|
||||
if (this._currentPromptInputState.cursorIndex < this._initialPromptInputState.cursorIndex) {
|
||||
this.hideSuggestWidget();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._terminalSuggestWidgetVisibleContextKey.get()) {
|
||||
const inputBeforeCursor = this._currentPromptInputState.value.substring(0, this._currentPromptInputState.cursorIndex);
|
||||
this._cursorIndexDelta = this._currentPromptInputState.cursorIndex - this._initialPromptInputState.cursorIndex;
|
||||
|
|
Loading…
Reference in a new issue