Change:
Just came across this code that conditionally leaves zen mode when side by side or diff editors are opened: We probably want something similar when a merge editor is opened.
enable centered editor layout open a merge editor verify centered editor layout exits
Verified

Discussion:
import { onDidChangeFullscreen, isFullscreen } from 'vs/base/browser/browser'; import { IWorkingCopyBackupService } from 'vs/workbench/services/workingCopy/common/workingCopyBackup'; import { isWindows, isLinux, isMacintosh, isWeb, isNative, isIOS } from 'vs/base/common/platform'; <del> import { isResourceEditorInput, IUntypedEditorInput, pathsToEditors } from 'vs/workbench/common/editor'; import { SideBySideEditorInput } from 'vs/workbench/common/editor/sideBySideEditorInput'; </del> <ins> import { EditorInputCapabilities, isResourceEditorInput, IUntypedEditorInput, pathsToEditors } from 'vs/workbench/common/editor'; </ins> import { SidebarPart } from 'vs/workbench/browser/parts/sidebar/sidebarPart'; import { PanelPart } from 'vs/workbench/browser/parts/panel/panelPart'; import { Position, Parts, PanelOpensMaximizedOptions, IWorkbenchLayoutService, positionFromString, positionToString, panelOpensMaximizedFromString, PanelAlignment } from 'vs/workbench/services/layout/browser/layoutService';

centerEditorLayout(active: boolean, skipLayout?: boolean): void { this.stateModel.setRuntimeValue(LayoutStateKeys.EDITOR_CENTERED, active); <del> let smartActive = active; </del> const activeEditor = this.editorService.activeEditor; <del> let isEditorSplit = false; </del> <ins> let isEditorComplex = false; </ins> if (activeEditor instanceof DiffEditorInput) { <del> isEditorSplit = this.configurationService.getValue('diffEditor.renderSideBySide'); } else if (activeEditor instanceof SideBySideEditorInput) { isEditorSplit = true; </del> <ins> isEditorComplex = this.configurationService.getValue('diffEditor.renderSideBySide'); } else if (activeEditor?.hasCapability(EditorInputCapabilities.MultipleEditors)) { isEditorComplex = true; </ins> } const isCenteredLayoutAutoResizing = this.configurationService.getValue('workbench.editor.centeredLayoutAutoResize'); if ( isCenteredLayoutAutoResizing && <del> (this.editorGroupService.groups.length > 1 || isEditorSplit) </del> <ins> (this.editorGroupService.groups.length > 1 || isEditorComplex) </ins> ) { <del> smartActive = false; </del> <ins> active = false; // disable centered layout for complex editors or when there is more than one group </ins> } <del> // Enter Centered Editor Layout if (this.editorGroupService.isLayoutCentered() !== smartActive) { this.editorGroupService.centerLayout(smartActive); </del> <ins> if (this.editorGroupService.isLayoutCentered() !== active) { this.editorGroupService.centerLayout(active); </ins> if (!skipLayout) { this.layout();

* editor by holding shift. */ CanDropIntoEditor = 1 << 7, <ins> /** * Signals that the editor is composed of multiple editors * within. */ MultipleEditors = 1 << 8 </ins> } export type IUntypedEditorInput = IResourceEditorInput | ITextResourceEditorInput | IUntitledTextResourceEditorInput | IResourceDiffEditorInput | IResourceSideBySideEditorInput | IResourceMergeEditorInput;

capabilities |= EditorInputCapabilities.Singleton; } <ins> // Indicate we show more than one editor capabilities |= EditorInputCapabilities.MultipleEditors; </ins> return capabilities; }

import { IFileService } from 'vs/platform/files/common/files'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ILabelService } from 'vs/platform/label/common/label'; <del> import { IEditorIdentifier, IResourceMergeEditorInput, isResourceMergeEditorInput, IUntypedEditorInput } from 'vs/workbench/common/editor'; </del> <ins> import { EditorInputCapabilities, IEditorIdentifier, IResourceMergeEditorInput, isResourceMergeEditorInput, IUntypedEditorInput } from 'vs/workbench/common/editor'; </ins> import { EditorInput, IEditorCloseHandler } from 'vs/workbench/common/editor/editorInput'; import { AbstractTextResourceEditorInput } from 'vs/workbench/common/editor/textResourceEditorInput'; import { EditorWorkerServiceDiffComputer } from 'vs/workbench/contrib/mergeEditor/browser/model/diffComputer';

return MergeEditorInput.ID; } <ins> override get capabilities(): EditorInputCapabilities { return super.capabilities | EditorInputCapabilities.MultipleEditors; } </ins> override getName(): string { return localize('name', "Merging: {0}", super.getName()); }

testInput2.capabilities = EditorInputCapabilities.None; const sideBySideInput = instantiationService.createInstance(SideBySideEditorInput, 'name', undefined, testInput1, testInput2); <del> assert.strictEqual(sideBySideInput.hasCapability(EditorInputCapabilities.None), true); </del> <ins> assert.strictEqual(sideBySideInput.hasCapability(EditorInputCapabilities.MultipleEditors), true); </ins> assert.strictEqual(sideBySideInput.hasCapability(EditorInputCapabilities.Readonly), false); assert.strictEqual(sideBySideInput.hasCapability(EditorInputCapabilities.Untitled), false); assert.strictEqual(sideBySideInput.hasCapability(EditorInputCapabilities.RequiresTrust), false);