From 97ff3e51ff425a8da52cb88c269f2e59ff2724af Mon Sep 17 00:00:00 2001 From: Benjamin Christopher Simmonds <44439583+benibenj@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:12:25 +0100 Subject: [PATCH] Prevent NES flickering when switching tab actions (#238133) fixes https://github.com/microsoft/vscode-copilot/issues/11743 --- .../inlineCompletions/browser/view/inlineEdits/view.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.ts b/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.ts index 8f8286d43a8d6..37aea03afe9ce 100644 --- a/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.ts +++ b/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.ts @@ -81,7 +81,12 @@ export class InlineEditsView extends Disposable { )!; this._previewTextModel.setLanguage(this._editor.getModel()!.getLanguageId()); - this._previewTextModel.setValue(newText); + + const previousNewText = this._previewTextModel.getValue(); + if (previousNewText !== newText) { + // Only update the model if the text has changed to avoid flickering + this._previewTextModel.setValue(newText); + } return { state,