From 52e56ad19ae0b7cc812f85fa6dcb98928b2ba00d Mon Sep 17 00:00:00 2001 From: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Date: Thu, 25 May 2023 16:56:05 +0200 Subject: [PATCH] SCM - fix input flickering (#183440) --- src/vs/workbench/contrib/scm/browser/scmViewPane.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/vs/workbench/contrib/scm/browser/scmViewPane.ts b/src/vs/workbench/contrib/scm/browser/scmViewPane.ts index 7b8f2ce8d4122..bc33ef351cb0d 100644 --- a/src/vs/workbench/contrib/scm/browser/scmViewPane.ts +++ b/src/vs/workbench/contrib/scm/browser/scmViewPane.ts @@ -224,6 +224,7 @@ class SCMTreeDragAndDrop implements ITreeDragAndDrop { interface InputTemplate { readonly inputWidget: SCMInputWidget; + inputWidgetHeight: number; readonly elementDisposables: DisposableStore; readonly templateDisposable: IDisposable; } @@ -258,7 +259,7 @@ class InputRenderer implements ICompressibleTreeRenderer, index: number, templateData: InputTemplate): void { @@ -268,10 +269,7 @@ class InputRenderer implements ICompressibleTreeRenderer { - this.inputWidgets.delete(input); - this.contentHeights.delete(input); - } + dispose: () => this.inputWidgets.delete(input) }); // Widget cursor selections @@ -292,11 +290,11 @@ class InputRenderer implements ICompressibleTreeRenderer { const contentHeight = templateData.inputWidget.getContentHeight(); - const lastContentHeight = this.contentHeights.get(input)!; this.contentHeights.set(input, contentHeight); - if (lastContentHeight !== contentHeight) { + if (templateData.inputWidgetHeight !== contentHeight) { this.updateHeight(input, contentHeight + 10); + templateData.inputWidgetHeight = contentHeight; templateData.inputWidget.layout(); } };