提交 0f4cde30 编写于 作者: B Benjamin Pasero

grid - tweak some groups access order

上级 4ead3664
...@@ -161,9 +161,14 @@ export class JoinTwoGroupsAction extends Action { ...@@ -161,9 +161,14 @@ export class JoinTwoGroupsAction extends Action {
sourceGroup = this.editorGroupService.activeGroup; sourceGroup = this.editorGroupService.activeGroup;
} }
const targetGroup = this.editorGroupService.findGroup({ direction: GroupDirection.RIGHT }, sourceGroup) || this.editorGroupService.findGroup({ direction: GroupDirection.DOWN }, sourceGroup); const targetGroupDirections = [GroupDirection.RIGHT, GroupDirection.DOWN, GroupDirection.LEFT, GroupDirection.UP];
for (let i = 0; i < targetGroupDirections.length; i++) {
const targetGroup = this.editorGroupService.findGroup({ direction: targetGroupDirections[i] }, sourceGroup);
if (targetGroup && sourceGroup !== targetGroup) { if (targetGroup && sourceGroup !== targetGroup) {
this.editorGroupService.mergeGroup(sourceGroup, targetGroup); this.editorGroupService.mergeGroup(sourceGroup, targetGroup);
return TPromise.as(true);
}
} }
return TPromise.as(true); return TPromise.as(true);
...@@ -663,7 +668,7 @@ export class CloseEditorsInOtherGroupsAction extends Action { ...@@ -663,7 +668,7 @@ export class CloseEditorsInOtherGroupsAction extends Action {
public run(context?: IEditorIdentifier): TPromise<any> { public run(context?: IEditorIdentifier): TPromise<any> {
const groupToSkip = context ? this.editorGroupService.getGroup(context.groupId) : this.editorGroupService.activeGroup; const groupToSkip = context ? this.editorGroupService.getGroup(context.groupId) : this.editorGroupService.activeGroup;
return TPromise.join(this.editorGroupService.groups.map(g => { return TPromise.join(this.editorGroupService.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE).map(g => {
if (g.id === groupToSkip.id) { if (g.id === groupToSkip.id) {
return TPromise.as(null); return TPromise.as(null);
} }
......
...@@ -207,7 +207,7 @@ function registerEditorGroupsLayoutCommand(): void { ...@@ -207,7 +207,7 @@ function registerEditorGroupsLayoutCommand(): void {
export function mergeAllGroups(editorGroupService: IEditorGroupsService): void { export function mergeAllGroups(editorGroupService: IEditorGroupsService): void {
const target = editorGroupService.activeGroup; const target = editorGroupService.activeGroup;
editorGroupService.groups.forEach(group => { editorGroupService.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE).forEach(group => {
if (group === target) { if (group === target) {
return; // keep target return; // keep target
} }
......
...@@ -206,7 +206,7 @@ export class AllEditorsPicker extends BaseEditorPicker { ...@@ -206,7 +206,7 @@ export class AllEditorsPicker extends BaseEditorPicker {
protected getEditorEntries(): EditorPickerEntry[] { protected getEditorEntries(): EditorPickerEntry[] {
const entries: EditorPickerEntry[] = []; const entries: EditorPickerEntry[] = [];
this.editorGroupService.groups.forEach(group => { this.editorGroupService.getGroups(GroupsOrder.CREATION_TIME).forEach(group => {
group.editors.forEach(editor => { group.editors.forEach(editor => {
entries.push(this.instantiationService.createInstance(EditorPickerEntry, editor, group)); entries.push(this.instantiationService.createInstance(EditorPickerEntry, editor, group));
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册