Skip to content

Commit 91a664f

Browse files
authored
SCM - fix edge case with setting the active repository (microsoft#257494)
1 parent aa876a2 commit 91a664f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ export class SCMRepositoriesViewPane extends ViewPane {
230230

231231
this._register(this.tree.onDidChangeSelection(this.onTreeSelectionChange, this));
232232
this._register(this.tree.onDidChangeFocus(this.onTreeDidChangeFocus, this));
233+
this._register(this.tree.onDidFocus(this.onDidTreeFocus, this));
233234
this._register(this.tree.onContextMenu(this.onTreeContextMenu, this));
234235
this._register(this.tree.onDidChangeContentHeight(this.onTreeContentHeightChange, this));
235236
}
@@ -274,6 +275,13 @@ export class SCMRepositoriesViewPane extends ViewPane {
274275
}
275276
}
276277

278+
private onDidTreeFocus(): void {
279+
const focused = this.tree.getFocus();
280+
if (focused.length > 0) {
281+
this.scmViewService.focus(focused[0]);
282+
}
283+
}
284+
277285
private onTreeContentHeightChange(height: number): void {
278286
this.updateBodySize(height);
279287

0 commit comments

Comments
 (0)