From 587a1047bcb4bdf599f20165d4379875b456962c Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 3 Oct 2017 15:33:37 +0200 Subject: [PATCH] update scm viewlet based on initial selection fixes #35497 --- src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts b/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts index 09fed0a3ba0..990928f0af8 100644 --- a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts +++ b/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts @@ -244,6 +244,10 @@ class MainPanel extends ViewletPanel { this.list.setSelection([...selection.slice(0, index), ...selection.slice(index + 1)]); } + getSelection(): ISCMRepository[] { + return this.list.getSelectedElements(); + } + private splice(index: number, deleteCount: number, repositories: ISCMRepository[] = []): void { const wasEmpty = this.list.length === 0; @@ -854,6 +858,7 @@ export class SCMViewlet extends PanelViewlet implements IViewModel { this.addPanel(this.mainPanel, this.mainPanel.minimumSize, 0); const selectionChangeDisposable = this.mainPanel.onSelectionChange(this.onSelectionChange, this); + this.onSelectionChange(this.mainPanel.getSelection()); this.mainPanelDisposable = toDisposable(() => { this.removePanel(this.mainPanel);