Skip to content

Commit 8cc4a70

Browse files
committed
fix #51866
1 parent bed8ab9 commit 8cc4a70

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/vs/workbench/browser/parts/editor/editorCommands.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ function moveActiveTab(args: ActiveEditorMoveArguments, control: IEditor, access
139139
function moveActiveEditorToGroup(args: ActiveEditorMoveArguments, control: IEditor, accessor: ServicesAccessor): void {
140140
const editorGroupService = accessor.get(IEditorGroupsService);
141141

142-
const groups = editorGroupService.groups;
143142
const sourceGroup = control.group;
144143
let targetGroup: IEditorGroup;
145144

@@ -181,10 +180,10 @@ function moveActiveEditorToGroup(args: ActiveEditorMoveArguments, control: IEdit
181180
targetGroup = editorGroupService.findGroup({ location: GroupLocation.NEXT }, sourceGroup);
182181
break;
183182
case 'center':
184-
targetGroup = groups[(groups.length / 2) - 1];
183+
targetGroup = editorGroupService.getGroups(GroupsOrder.GRID_APPEARANCE)[(editorGroupService.count / 2) - 1];
185184
break;
186185
case 'position':
187-
targetGroup = groups[args.value - 1];
186+
targetGroup = editorGroupService.getGroups(GroupsOrder.GRID_APPEARANCE)[args.value - 1];
188187
break;
189188
}
190189

@@ -330,7 +329,7 @@ function registerFocusEditorGroupAtIndexCommands(): void {
330329
}
331330

332331
// Group exists: just focus
333-
const groups = editorGroupService.getGroups(GroupsOrder.CREATION_TIME);
332+
const groups = editorGroupService.getGroups(GroupsOrder.GRID_APPEARANCE);
334333
if (groups[groupIndex]) {
335334
return groups[groupIndex].focus();
336335
}

src/vs/workbench/browser/parts/editor/editorPart.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
239239

240240
private doFindGroupByLocation(location: GroupLocation, source: IEditorGroupView | GroupIdentifier, wrap?: boolean): IEditorGroupView {
241241
const sourceGroupView = this.assertGroupView(source);
242-
const groups = this.getGroups(GroupsOrder.CREATION_TIME);
242+
const groups = this.getGroups(GroupsOrder.GRID_APPEARANCE);
243243
const index = groups.indexOf(sourceGroupView);
244244

245245
switch (location) {

0 commit comments

Comments
 (0)