提交 a2fa9497 编写于 作者: P petevdp

allow the inline diff editor to be centered

上级 ac5d1a09
......@@ -44,6 +44,7 @@ import { LineNumbersType } from 'vs/editor/common/config/editorOptions';
import { ActivitybarPart } from 'vs/workbench/browser/parts/activitybar/activitybarPart';
import { URI } from 'vs/base/common/uri';
import { IViewDescriptorService, ViewContainerLocation } from 'vs/workbench/common/views';
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
export enum Settings {
ACTIVITYBAR_VISIBLE = 'workbench.activityBar.visible',
......@@ -398,6 +399,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
const newMenubarVisibility = getMenuBarVisibility(this.configurationService, this.environmentService);
this.setMenubarVisibility(newMenubarVisibility, !!skipLayout);
// Centered Layout
this.centerEditorLayout(this.state.editor.centered, skipLayout);
}
private setSideBarPosition(position: Position): void {
......@@ -1208,9 +1211,18 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
let smartActive = active;
const activeEditor = this.editorService.activeEditor;
if (this.configurationService.getValue('workbench.editor.centeredLayoutAutoResize')
&& (this.editorGroupService.groups.length > 1 || (activeEditor && activeEditor instanceof SideBySideEditorInput))) {
smartActive = false; // Respect the auto resize setting - do not go into centered layout if there is more than 1 group.
const isSideBySideLayout = activeEditor
&& activeEditor instanceof SideBySideEditorInput
// DiffEditorInput inherits from SideBySideEditorInput but can still be functionally an inline editor.
&& (!(activeEditor instanceof DiffEditorInput) || this.configurationService.getValue('diffEditor.renderSideBySide'));
const isCenteredLayoutAutoResizing = this.configurationService.getValue('workbench.editor.centeredLayoutAutoResize');
if (
isCenteredLayoutAutoResizing
&& (this.editorGroupService.groups.length > 1 || isSideBySideLayout)
) {
smartActive = false;
}
// Enter Centered Editor Layout
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册