Skip to content

Commit 1b01ed0

Browse files
authored
1 parent 44ef5cc commit 1b01ed0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/vs/editor/contrib/inlineCompletions/browser/ghostText.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ export class GhostTextReplacement {
114114
get lineCount(): number {
115115
return this.newLines.length;
116116
}
117+
118+
isEmpty(): boolean {
119+
return this.parts.every(p => p.lines.length === 0);
120+
}
117121
}
118122

119123
export type GhostTextOrReplacement = GhostText | GhostTextReplacement;

src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionContextKeys.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class InlineCompletionContextKeys extends Disposable {
3333
const suggestion = model?.selectedInlineCompletion.read(reader);
3434
const ghostText = model?.ghostText.read(reader);
3535
const selectedSuggestItem = model?.selectedSuggestItem.read(reader);
36-
this.inlineCompletionVisible.set(selectedSuggestItem === undefined && ghostText !== undefined);
36+
this.inlineCompletionVisible.set(selectedSuggestItem === undefined && ghostText !== undefined && !ghostText.isEmpty());
3737

3838
if (ghostText && suggestion) {
3939
this.suppressSuggestions.set(suggestion.inlineCompletion.source.inlineCompletions.suppressSuggestions);

0 commit comments

Comments
 (0)