Skip to content

Commit 72ea2ad

Browse files
committed
layout: reziePart use editorCountForWidth
1 parent 6b5850e commit 72ea2ad

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/vs/workbench/browser/layout.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)