@@ -335,7 +335,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
335
335
this . _register ( this . editorGroupService . mainPart . onDidActivateGroup ( showEditorIfHidden ) ) ;
336
336
337
337
// Revalidate center layout when active editor changes: diff editor quits centered mode.
338
- this . _register ( this . editorService . onDidActiveEditorChange ( ( ) => this . centerEditorLayout ( this . stateModel . getRuntimeValue ( LayoutStateKeys . EDITOR_CENTERED ) ) ) ) ;
338
+ this . _register ( this . mainPartEditorService . onDidActiveEditorChange ( ( ) => this . centerMainEditorLayout ( this . stateModel . getRuntimeValue ( LayoutStateKeys . EDITOR_CENTERED ) ) ) ) ;
339
339
} ) ;
340
340
341
341
// Configuration changes
@@ -358,8 +358,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
358
358
this . _register ( onDidChangeFullscreen ( ( ) => this . onFullscreenChanged ( ) ) ) ;
359
359
360
360
// Group changes
361
- this . _register ( this . editorGroupService . onDidAddGroup ( ( ) => this . centerEditorLayout ( this . stateModel . getRuntimeValue ( LayoutStateKeys . EDITOR_CENTERED ) ) ) ) ;
362
- this . _register ( this . editorGroupService . onDidRemoveGroup ( ( ) => this . centerEditorLayout ( this . stateModel . getRuntimeValue ( LayoutStateKeys . EDITOR_CENTERED ) ) ) ) ;
361
+ this . _register ( this . editorGroupService . mainPart . onDidAddGroup ( ( ) => this . centerMainEditorLayout ( this . stateModel . getRuntimeValue ( LayoutStateKeys . EDITOR_CENTERED ) ) ) ) ;
362
+ this . _register ( this . editorGroupService . mainPart . onDidRemoveGroup ( ( ) => this . centerMainEditorLayout ( this . stateModel . getRuntimeValue ( LayoutStateKeys . EDITOR_CENTERED ) ) ) ) ;
363
363
364
364
// Prevent workbench from scrolling #55456
365
365
this . _register ( addDisposableListener ( this . mainContainer , EventType . SCROLL , ( ) => this . mainContainer . scrollTop = 0 ) ) ;
@@ -485,7 +485,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
485
485
486
486
// Centered Layout
487
487
this . editorGroupService . mainPart . whenRestored . then ( ( ) => {
488
- this . centerEditorLayout ( this . stateModel . getRuntimeValue ( LayoutStateKeys . EDITOR_CENTERED ) , skipLayout ) ;
488
+ this . centerMainEditorLayout ( this . stateModel . getRuntimeValue ( LayoutStateKeys . EDITOR_CENTERED ) , skipLayout ) ;
489
489
} ) ;
490
490
}
491
491
@@ -1047,9 +1047,9 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
1047
1047
this . toggleZenMode ( false , true ) ;
1048
1048
}
1049
1049
1050
- // Restore Editor Center Mode
1050
+ // Restore Main Editor Center Mode
1051
1051
if ( this . stateModel . getRuntimeValue ( LayoutStateKeys . EDITOR_CENTERED ) ) {
1052
- this . centerEditorLayout ( true , true ) ;
1052
+ this . centerMainEditorLayout ( true , true ) ;
1053
1053
}
1054
1054
1055
1055
// Await for promises that we recorded to update
@@ -1320,7 +1320,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
1320
1320
1321
1321
if ( ! restoring ) {
1322
1322
zenModeExitInfo . transitionedToFullScreen = toggleFullScreen ;
1323
- zenModeExitInfo . transitionedToCenteredEditorLayout = ! this . isEditorLayoutCentered ( ) && config . centerLayout ;
1323
+ zenModeExitInfo . transitionedToCenteredEditorLayout = ! this . isMainEditorLayoutCentered ( ) && config . centerLayout ;
1324
1324
zenModeExitInfo . handleNotificationsDoNotDisturbMode = ! this . notificationService . doNotDisturbMode ;
1325
1325
zenModeExitInfo . wasVisible . sideBar = this . isVisible ( Parts . SIDEBAR_PART ) ;
1326
1326
zenModeExitInfo . wasVisible . panel = this . isVisible ( Parts . PANEL_PART ) ;
@@ -1362,7 +1362,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
1362
1362
} ) ) ;
1363
1363
1364
1364
if ( config . centerLayout ) {
1365
- this . centerEditorLayout ( true , true ) ;
1365
+ this . centerMainEditorLayout ( true , true ) ;
1366
1366
}
1367
1367
}
1368
1368
@@ -1389,7 +1389,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
1389
1389
}
1390
1390
1391
1391
if ( zenModeExitInfo . transitionedToCenteredEditorLayout ) {
1392
- this . centerEditorLayout ( false , true ) ;
1392
+ this . centerMainEditorLayout ( false , true ) ;
1393
1393
}
1394
1394
1395
1395
if ( zenModeExitInfo . handleNotificationsDoNotDisturbMode ) {
@@ -1530,32 +1530,32 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
1530
1530
}
1531
1531
}
1532
1532
1533
- isEditorLayoutCentered ( ) : boolean {
1533
+ isMainEditorLayoutCentered ( ) : boolean {
1534
1534
return this . stateModel . getRuntimeValue ( LayoutStateKeys . EDITOR_CENTERED ) ;
1535
1535
}
1536
1536
1537
- centerEditorLayout ( active : boolean , skipLayout ?: boolean ) : void {
1537
+ centerMainEditorLayout ( active : boolean , skipLayout ?: boolean ) : void {
1538
1538
this . stateModel . setRuntimeValue ( LayoutStateKeys . EDITOR_CENTERED , active ) ;
1539
1539
1540
- const activeEditor = this . editorService . activeEditor ;
1540
+ const activeMainEditor = this . mainPartEditorService . activeEditor ;
1541
1541
1542
1542
let isEditorComplex = false ;
1543
- if ( activeEditor instanceof DiffEditorInput ) {
1543
+ if ( activeMainEditor instanceof DiffEditorInput ) {
1544
1544
isEditorComplex = this . configurationService . getValue ( 'diffEditor.renderSideBySide' ) ;
1545
- } else if ( activeEditor ?. hasCapability ( EditorInputCapabilities . MultipleEditors ) ) {
1545
+ } else if ( activeMainEditor ?. hasCapability ( EditorInputCapabilities . MultipleEditors ) ) {
1546
1546
isEditorComplex = true ;
1547
1547
}
1548
1548
1549
1549
const isCenteredLayoutAutoResizing = this . configurationService . getValue ( 'workbench.editor.centeredLayoutAutoResize' ) ;
1550
1550
if (
1551
1551
isCenteredLayoutAutoResizing &&
1552
- ( this . editorGroupService . groups . length > 1 || isEditorComplex )
1552
+ ( this . editorGroupService . mainPart . groups . length > 1 || isEditorComplex )
1553
1553
) {
1554
1554
active = false ; // disable centered layout for complex editors or when there is more than one group
1555
1555
}
1556
1556
1557
- if ( this . editorGroupService . isLayoutCentered ( ) !== active ) {
1558
- this . editorGroupService . centerLayout ( active ) ;
1557
+ if ( this . editorGroupService . mainPart . isLayoutCentered ( ) !== active ) {
1558
+ this . editorGroupService . mainPart . centerLayout ( active ) ;
1559
1559
1560
1560
if ( ! skipLayout ) {
1561
1561
this . layout ( ) ;
@@ -1877,7 +1877,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
1877
1877
}
1878
1878
1879
1879
if ( focusEditor ) {
1880
- this . editorGroupService . activeGroup . focus ( ) ; // Pass focus to editor group if panel part is now hidden
1880
+ this . editorGroupService . mainPart . activeGroup . focus ( ) ; // Pass focus to editor group if panel part is now hidden
1881
1881
}
1882
1882
}
1883
1883
0 commit comments