diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index e8d196a218b12..ac32addcfeed8 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -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