提交 12ec4483 编写于 作者: B Benjamin Pasero

grid - some fixes

上级 e9fb7ea7
......@@ -52,22 +52,20 @@ export class GridOpenEditorsAction extends Action {
return this.legacyEditorService.createInput({ resource: URI.file(input) }) as EditorInput;
});
setTimeout(() => {
const firstGroup = this.nextEditorGroupsService.activeGroup;
firstGroup.openEditor(inputs[0], { pinned: true });
firstGroup.openEditor(inputs[1], { inactive: true, pinned: true });
firstGroup.openEditor(inputs[2], { inactive: true, pinned: true });
const secondGroup = this.nextEditorGroupsService.addGroup(firstGroup, Direction.DOWN);
secondGroup.openEditor(inputs[3], { pinned: true, preserveFocus: true });
secondGroup.openEditor(inputs[4], { inactive: true, pinned: true });
const thirdGroup = this.nextEditorGroupsService.addGroup(secondGroup, Direction.RIGHT);
thirdGroup.openEditor(inputs[5], { pinned: true, preserveFocus: true });
thirdGroup.openEditor(inputs[6], { inactive: true, pinned: true });
this.nextEditorGroupsService.addGroup(firstGroup, Direction.RIGHT); // play with empty group
}, 0);
const firstGroup = this.nextEditorGroupsService.activeGroup;
firstGroup.openEditor(inputs[0], { pinned: true });
firstGroup.openEditor(inputs[1], { inactive: true, pinned: true });
firstGroup.openEditor(inputs[2], { inactive: true, pinned: true });
const secondGroup = this.nextEditorGroupsService.addGroup(firstGroup, Direction.DOWN);
secondGroup.openEditor(inputs[3], { pinned: true, preserveFocus: true });
secondGroup.openEditor(inputs[4], { inactive: true, pinned: true });
const thirdGroup = this.nextEditorGroupsService.addGroup(secondGroup, Direction.RIGHT);
thirdGroup.openEditor(inputs[5], { pinned: true, preserveFocus: true });
thirdGroup.openEditor(inputs[6], { inactive: true, pinned: true });
this.nextEditorGroupsService.addGroup(firstGroup, Direction.RIGHT); // play with empty group
return TPromise.as(void 0);
}
......
......@@ -24,6 +24,7 @@ export const NoEditorsVisibleContext: ContextKeyExpr = EditorsVisibleContext.toN
export const TextCompareEditorVisibleContext = new RawContextKey<boolean>('textCompareEditorVisible', false);
export const ActiveEditorGroupEmptyContext = new RawContextKey<boolean>('activeEditorGroupEmpty', false);
export const MultipleEditorGroupsContext = new RawContextKey<boolean>('multipleEditorGroups', false);
export const SingleEditorGroupsContext = MultipleEditorGroupsContext.toNegated();
export const InEditorZenModeContext = new RawContextKey<boolean>('inZenMode', false);
export enum ConfirmResult {
......
......@@ -22,7 +22,7 @@ import { PagedList } from 'vs/base/browser/ui/list/listPaging';
import { range } from 'vs/base/common/arrays';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { ITree } from 'vs/base/parts/tree/browser/tree';
import { InEditorZenModeContext, NoEditorsVisibleContext } from 'vs/workbench/common/editor';
import { InEditorZenModeContext, NoEditorsVisibleContext, SingleEditorGroupsContext } from 'vs/workbench/common/editor';
// --- List Commands
......@@ -504,7 +504,7 @@ export function registerCommands(): void {
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'workbench.action.closeWindow', // close the window when the last editor is closed by reusing the same keybinding
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
when: NoEditorsVisibleContext,
when: ContextKeyExpr.and(NoEditorsVisibleContext, SingleEditorGroupsContext),
primary: KeyMod.CtrlCmd | KeyCode.KEY_W,
handler: accessor => {
const windowService = accessor.get(IWindowService);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册