提交 dfb6572f 编写于 作者: A alexr00 提交者: Benjamin Pasero

Added a setting for configuring open direction for "open to the side" (#49523)

上级 03f7fe7a
......@@ -772,6 +772,7 @@ export interface IWorkbenchEditorPartConfiguration {
enablePreviewFromQuickOpen?: boolean;
closeOnFileDelete?: boolean;
openPositioning?: 'left' | 'right' | 'first' | 'last';
openToTheSideDirection?: 'left' | 'right' | 'up' | 'down';
revealIfOpen?: boolean;
swipeToNavigate?: boolean;
labelFormat?: 'default' | 'short' | 'medium' | 'long';
......
......@@ -212,6 +212,12 @@ configurationRegistry.registerConfiguration({
'default': 'right',
'description': nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'editorOpenPositioning' }, "Controls where editors open. Select 'left' or 'right' to open editors to the left or right of the currently active one. Select 'first' or 'last' to open editors independently from the currently active one.")
},
'workbench.editor.openToTheSideDirection': {
'type': 'string',
'enum': ['left', 'right', 'up', 'down'],
'default': 'right',
'description': nls.localize('openToTheSideDirection', "Controls where editors opened through the Open to Side option open. ")
},
'workbench.editor.revealIfOpen': {
'type': 'boolean',
'description': nls.localize('revealIfOpen', "Controls if an editor is revealed in any of the visible groups if opened. If disabled, an editor will prefer to open in the currently active editor group. If enabled, an already opened editor will be revealed instead of opened again in the currently active editor group. Note that there are some cases where this setting is ignored, e.g. when forcing an editor to open in a specific group or to the side of the currently active group."),
......
......@@ -269,7 +269,17 @@ export class NextEditorService extends Disposable implements INextEditorService
}
private createSideBySideGroup(): INextEditorGroup {
return this.nextEditorGroupsService.addGroup(this.nextEditorGroupsService.activeGroup, GroupDirection.RIGHT); // TODO@grid this should use an existing side group if there is one
const direction = this.configurationService.getValue<'left' | 'right' | 'up' | 'down'>('workbench.editor.openToTheSideDirection');
let groupDirection: GroupDirection = GroupDirection.RIGHT;
switch (direction) {
case 'left': groupDirection = GroupDirection.LEFT; break;
case 'right': groupDirection = GroupDirection.RIGHT; break;
case 'up': groupDirection = GroupDirection.UP; break;
case 'down': groupDirection = GroupDirection.DOWN; break;
default: groupDirection = GroupDirection.RIGHT;
}
return this.nextEditorGroupsService.addGroup(this.nextEditorGroupsService.activeGroup, groupDirection);
}
private toOptions(options?: IEditorOptions | EditorOptions): EditorOptions {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册