Skip to content

Commit 391c92f

Browse files
committed
1 parent 2f2ba0d commit 391c92f

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/vs/workbench/common/views.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,8 @@ export interface IView {
465465

466466
readonly id: string;
467467

468+
focus(): void;
469+
468470
isVisible(): boolean;
469471

470472
isBodyVisible(): boolean;

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,10 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
7474
win: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G },
7575
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G },
7676
mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_G },
77-
handler: accessor => {
77+
handler: async accessor => {
7878
const viewsService = accessor.get(IViewsService);
79-
80-
if (viewsService.isViewVisible(VIEW_PANE_ID)) {
81-
viewsService.closeView(VIEW_PANE_ID);
82-
} else {
83-
viewsService.openView(VIEW_PANE_ID);
84-
}
79+
const view = await viewsService.openView(VIEW_PANE_ID);
80+
view?.focus();
8581
}
8682
});
8783

0 commit comments

Comments
 (0)