Skip to content

Commit d5942ca

Browse files
committed
1 parent f11608c commit d5942ca

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/vs/workbench/contrib/scm/browser/scmViewPane.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -316,19 +316,19 @@ class InputRenderer implements ICompressibleTreeRenderer<ISCMInput, FuzzyScore,
316316
}
317317
};
318318

319-
const initialRender = () => {
319+
const startListeningContentHeightChange = () => {
320320
disposables.add(templateData.inputWidget.onDidChangeContentHeight(onDidChangeContentHeight));
321-
onDidChangeContentHeight();
322-
};
323321

324-
const contentHeight = templateData.inputWidget.getContentHeight();
322+
const contentHeight = templateData.inputWidget.getContentHeight();
325323

326-
if (contentHeight !== InputRenderer.DEFAULT_HEIGHT) {
327-
const timeout = setTimeout(initialRender, 0);
328-
disposables.add({ dispose: () => clearTimeout(timeout) });
329-
} else {
330-
initialRender();
331-
}
324+
if (contentHeight !== InputRenderer.DEFAULT_HEIGHT) {
325+
onDidChangeContentHeight();
326+
}
327+
};
328+
329+
// Setup height change listener on next tick
330+
const timeout = setTimeout(startListeningContentHeightChange, 0);
331+
disposables.add({ dispose: () => clearTimeout(timeout) });
332332

333333
// Layout the editor whenever the outer layout happens
334334
const layoutEditor = () => templateData.inputWidget.layout();

0 commit comments

Comments
 (0)