@@ -710,7 +710,6 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
710710
711711 // change part size along the main axis
712712 public resizePart ( part : Parts , sizeChange : number ) : void {
713- const visibleEditorCount = this . editorService . getVisibleEditors ( ) . length ;
714713 const panelPosition = this . partService . getPanelPosition ( ) ;
715714 const sizeChangePxWidth = this . workbenchSize . width * ( sizeChange / 100 ) ;
716715 const sizeChangePxHeight = this . workbenchSize . height * ( sizeChange / 100 ) ;
@@ -721,8 +720,8 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
721720 case Parts . SIDEBAR_PART :
722721 this . sidebarWidth = this . sidebarWidth + sizeChangePxWidth ; // Sidebar can not become smaller than MIN_PART_WIDTH
723722
724- if ( this . layoutEditorGroupsVertically && ( this . workbenchSize . width - this . sidebarWidth < visibleEditorCount * MIN_EDITOR_PART_WIDTH ) ) {
725- this . sidebarWidth = ( this . workbenchSize . width - visibleEditorCount * MIN_EDITOR_PART_WIDTH ) ;
723+ if ( this . layoutEditorGroupsVertically && ( this . workbenchSize . width - this . sidebarWidth < this . editorCountForWidth * MIN_EDITOR_PART_WIDTH ) ) {
724+ this . sidebarWidth = ( this . workbenchSize . width - this . editorCountForWidth * MIN_EDITOR_PART_WIDTH ) ;
726725 }
727726
728727 doLayout = true ;
@@ -739,7 +738,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
739738 case Parts . EDITOR_PART :
740739 // If we have one editor we can cheat and resize sidebar with the negative delta
741740 // If the sidebar is not visible and panel is, resize panel main axis with negative Delta
742- if ( visibleEditorCount === 1 ) {
741+ if ( this . editorCountForWidth === 1 ) {
743742 if ( this . partService . isVisible ( Parts . SIDEBAR_PART ) ) {
744743 this . sidebarWidth = this . sidebarWidth - sizeChangePxWidth ;
745744 doLayout = true ;
0 commit comments