mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-24 09:21:35 +01:00
Use terminal suggest trigger chars even when widget is visible
Fixes #222187
This commit is contained in:
@@ -184,12 +184,11 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
|
||||
private _sync(promptInputState: IPromptInputModelState): void {
|
||||
const config = this._configurationService.getValue<ITerminalSuggestConfiguration>(terminalSuggestConfigSection);
|
||||
|
||||
if (!this._terminalSuggestWidgetVisibleContextKey.get()) {
|
||||
// If input has been added
|
||||
if (!this._mostRecentPromptInputState || promptInputState.cursorIndex > this._mostRecentPromptInputState.cursorIndex) {
|
||||
let sent = false;
|
||||
|
||||
// Quick suggestions
|
||||
// If input has been added
|
||||
let sent = false;
|
||||
if (!this._mostRecentPromptInputState || promptInputState.cursorIndex > this._mostRecentPromptInputState.cursorIndex) {
|
||||
// Quick suggestions
|
||||
if (!this._terminalSuggestWidgetVisibleContextKey.get()) {
|
||||
if (config.quickSuggestions) {
|
||||
const completionPrefix = promptInputState.value.substring(0, promptInputState.cursorIndex);
|
||||
if (promptInputState.cursorIndex === 1 || completionPrefix.match(/([\s\[])[^\s]$/)) {
|
||||
@@ -201,14 +200,14 @@ export class SuggestAddon extends Disposable implements ITerminalAddon, ISuggest
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger characters
|
||||
if (config.suggestOnTriggerCharacters && !sent) {
|
||||
const lastChar = promptInputState.value.at(promptInputState.cursorIndex - 1);
|
||||
if (lastChar?.match(/[\\\/\-]/)) {
|
||||
this._requestCompletions();
|
||||
sent = true;
|
||||
}
|
||||
// Trigger characters - this happens even if the widget is showing
|
||||
if (config.suggestOnTriggerCharacters && !sent) {
|
||||
const lastChar = promptInputState.value.at(promptInputState.cursorIndex - 1);
|
||||
if (lastChar?.match(/[\\\/\-]/)) {
|
||||
this._requestCompletions();
|
||||
sent = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user