Skip to content

Commit

Permalink
Calculate the sidebar optimal width correctly in case no folder is open
Browse files Browse the repository at this point in the history
  • Loading branch information
mquandalle committed Apr 15, 2016
1 parent b6036c7 commit bfe45ae
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/vs/workbench/parts/files/browser/explorerViewlet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ export class ExplorerViewlet extends Viewlet {

public getOptimalWidth(): number {
let additionalMargin = 16;
let optimalWidth = Math.max(
this.getWorkingFilesView().getOptimalWidth(),
this.getExplorerView().getOptimalWidth());
let workingFilesViewWidth = this.getWorkingFilesView().getOptimalWidth();
let explorerView = this.getExplorerView();
let explorerViewWidth = explorerView ? explorerView.getOptimalWidth() : 0;
let optimalWidth = Math.max(workingFilesViewWidth, explorerViewWidth);
return optimalWidth + additionalMargin;
}

Expand Down

0 comments on commit bfe45ae

Please sign in to comment.