Skip to content

Commit 36272bb

Browse files
committed
aux window - allow navigation between parts in window
1 parent f1db484 commit 36272bb

File tree

1 file changed

+35
-21
lines changed

1 file changed

+35
-21
lines changed

src/vs/workbench/browser/actions/navigationActions.ts

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/b
1717
import { ViewContainerLocation } from 'vs/workbench/common/views';
1818
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
1919
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
20-
import { mainWindow } from 'vs/base/browser/window';
20+
import { getActiveWindow } from 'vs/base/browser/dom';
21+
import { isAuxiliaryWindow } from 'vs/base/browser/window';
2122

2223
abstract class BaseNavigationAction extends Action2 {
2324

@@ -254,28 +255,41 @@ abstract class BaseFocusAction extends Action2 {
254255
}
255256

256257
private findVisibleNeighbour(layoutService: IWorkbenchLayoutService, part: Parts, next: boolean): Parts {
258+
const activeWindow = getActiveWindow();
259+
const windowIsAuxiliary = isAuxiliaryWindow(activeWindow);
260+
257261
let neighbour: Parts;
258-
switch (part) {
259-
case Parts.EDITOR_PART:
260-
neighbour = next ? Parts.PANEL_PART : Parts.SIDEBAR_PART;
261-
break;
262-
case Parts.PANEL_PART:
263-
neighbour = next ? Parts.STATUSBAR_PART : Parts.EDITOR_PART;
264-
break;
265-
case Parts.STATUSBAR_PART:
266-
neighbour = next ? Parts.ACTIVITYBAR_PART : Parts.PANEL_PART;
267-
break;
268-
case Parts.ACTIVITYBAR_PART:
269-
neighbour = next ? Parts.SIDEBAR_PART : Parts.STATUSBAR_PART;
270-
break;
271-
case Parts.SIDEBAR_PART:
272-
neighbour = next ? Parts.EDITOR_PART : Parts.ACTIVITYBAR_PART;
273-
break;
274-
default:
275-
neighbour = Parts.EDITOR_PART;
262+
if (windowIsAuxiliary) {
263+
switch (part) {
264+
case Parts.EDITOR_PART:
265+
neighbour = Parts.STATUSBAR_PART;
266+
break;
267+
default:
268+
neighbour = Parts.EDITOR_PART;
269+
}
270+
} else {
271+
switch (part) {
272+
case Parts.EDITOR_PART:
273+
neighbour = next ? Parts.PANEL_PART : Parts.SIDEBAR_PART;
274+
break;
275+
case Parts.PANEL_PART:
276+
neighbour = next ? Parts.STATUSBAR_PART : Parts.EDITOR_PART;
277+
break;
278+
case Parts.STATUSBAR_PART:
279+
neighbour = next ? Parts.ACTIVITYBAR_PART : Parts.PANEL_PART;
280+
break;
281+
case Parts.ACTIVITYBAR_PART:
282+
neighbour = next ? Parts.SIDEBAR_PART : Parts.STATUSBAR_PART;
283+
break;
284+
case Parts.SIDEBAR_PART:
285+
neighbour = next ? Parts.EDITOR_PART : Parts.ACTIVITYBAR_PART;
286+
break;
287+
default:
288+
neighbour = Parts.EDITOR_PART;
289+
}
276290
}
277291

278-
if (layoutService.isVisible(neighbour, mainWindow) || neighbour === Parts.EDITOR_PART) {
292+
if (layoutService.isVisible(neighbour, activeWindow) || neighbour === Parts.EDITOR_PART) {
279293
return neighbour;
280294
}
281295

@@ -296,7 +310,7 @@ abstract class BaseFocusAction extends Action2 {
296310
currentlyFocusedPart = Parts.PANEL_PART;
297311
}
298312

299-
layoutService.focusPart(currentlyFocusedPart ? this.findVisibleNeighbour(layoutService, currentlyFocusedPart, next) : Parts.EDITOR_PART, mainWindow);
313+
layoutService.focusPart(currentlyFocusedPart ? this.findVisibleNeighbour(layoutService, currentlyFocusedPart, next) : Parts.EDITOR_PART, getActiveWindow());
300314
}
301315
}
302316

0 commit comments

Comments
 (0)