@@ -9,8 +9,7 @@ import { EventType, addDisposableListener, getClientArea, Dimension, position, s
9
9
import { onDidChangeFullscreen , isFullscreen } from 'vs/base/browser/browser' ;
10
10
import { IWorkingCopyBackupService } from 'vs/workbench/services/workingCopy/common/workingCopyBackup' ;
11
11
import { isWindows , isLinux , isMacintosh , isWeb , isNative , isIOS } from 'vs/base/common/platform' ;
12
- import { isResourceEditorInput , IUntypedEditorInput , pathsToEditors } from 'vs/workbench/common/editor' ;
13
- import { SideBySideEditorInput } from 'vs/workbench/common/editor/sideBySideEditorInput' ;
12
+ import { EditorInputCapabilities , isResourceEditorInput , IUntypedEditorInput , pathsToEditors } from 'vs/workbench/common/editor' ;
14
13
import { SidebarPart } from 'vs/workbench/browser/parts/sidebar/sidebarPart' ;
15
14
import { PanelPart } from 'vs/workbench/browser/parts/panel/panelPart' ;
16
15
import { Position , Parts , PanelOpensMaximizedOptions , IWorkbenchLayoutService , positionFromString , positionToString , panelOpensMaximizedFromString , PanelAlignment } from 'vs/workbench/services/layout/browser/layoutService' ;
@@ -1309,27 +1308,25 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
1309
1308
centerEditorLayout ( active : boolean , skipLayout ?: boolean ) : void {
1310
1309
this . stateModel . setRuntimeValue ( LayoutStateKeys . EDITOR_CENTERED , active ) ;
1311
1310
1312
- let smartActive = active ;
1313
1311
const activeEditor = this . editorService . activeEditor ;
1314
1312
1315
- let isEditorSplit = false ;
1313
+ let isEditorComplex = false ;
1316
1314
if ( activeEditor instanceof DiffEditorInput ) {
1317
- isEditorSplit = this . configurationService . getValue ( 'diffEditor.renderSideBySide' ) ;
1318
- } else if ( activeEditor instanceof SideBySideEditorInput ) {
1319
- isEditorSplit = true ;
1315
+ isEditorComplex = this . configurationService . getValue ( 'diffEditor.renderSideBySide' ) ;
1316
+ } else if ( activeEditor ?. hasCapability ( EditorInputCapabilities . MultipleEditors ) ) {
1317
+ isEditorComplex = true ;
1320
1318
}
1321
1319
1322
1320
const isCenteredLayoutAutoResizing = this . configurationService . getValue ( 'workbench.editor.centeredLayoutAutoResize' ) ;
1323
1321
if (
1324
1322
isCenteredLayoutAutoResizing &&
1325
- ( this . editorGroupService . groups . length > 1 || isEditorSplit )
1323
+ ( this . editorGroupService . groups . length > 1 || isEditorComplex )
1326
1324
) {
1327
- smartActive = false ;
1325
+ active = false ; // disable centered layout for complex editors or when there is more than one group
1328
1326
}
1329
1327
1330
- // Enter Centered Editor Layout
1331
- if ( this . editorGroupService . isLayoutCentered ( ) !== smartActive ) {
1332
- this . editorGroupService . centerLayout ( smartActive ) ;
1328
+ if ( this . editorGroupService . isLayoutCentered ( ) !== active ) {
1329
+ this . editorGroupService . centerLayout ( active ) ;
1333
1330
1334
1331
if ( ! skipLayout ) {
1335
1332
this . layout ( ) ;
0 commit comments