Skip to content

Commit 587a104

Browse files
committed
update scm viewlet based on initial selection
fixes microsoft#35497
1 parent 3d63750 commit 587a104

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ class MainPanel extends ViewletPanel {
244244
this.list.setSelection([...selection.slice(0, index), ...selection.slice(index + 1)]);
245245
}
246246

247+
getSelection(): ISCMRepository[] {
248+
return this.list.getSelectedElements();
249+
}
250+
247251
private splice(index: number, deleteCount: number, repositories: ISCMRepository[] = []): void {
248252
const wasEmpty = this.list.length === 0;
249253

@@ -854,6 +858,7 @@ export class SCMViewlet extends PanelViewlet implements IViewModel {
854858
this.addPanel(this.mainPanel, this.mainPanel.minimumSize, 0);
855859

856860
const selectionChangeDisposable = this.mainPanel.onSelectionChange(this.onSelectionChange, this);
861+
this.onSelectionChange(this.mainPanel.getSelection());
857862

858863
this.mainPanelDisposable = toDisposable(() => {
859864
this.removePanel(this.mainPanel);

0 commit comments

Comments
 (0)