Skip to content

Commit

Permalink
Fixes editor has wrong height when toggling tabs with breadcrumbs vis…
Browse files Browse the repository at this point in the history
…ible (#97502)

* Fixes #97021

* Avoid calling relayout too often

* relayout on options change

Co-authored-by: Benjamin Pasero <benjpas@microsoft.com>
  • Loading branch information
jeanp413 and bpasero committed May 12, 2020
1 parent 895cf0f commit 4c467c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/vs/workbench/browser/parts/editor/editorGroupView.ts
Expand Up @@ -611,11 +611,11 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
// Title control Switch between showing tabs <=> not showing tabs
if (event.oldPartOptions.showTabs !== event.newPartOptions.showTabs) {

// Recreate and layout control
// Recreate title control
this.createTitleAreaControl();
if (this.dimension) {
this.layoutTitleAreaControl(this.dimension.width);
}

// Re-layout
this.relayout();

// Ensure to show active editor if any
if (this._group.activeEditor) {
Expand Down
Expand Up @@ -232,7 +232,7 @@ export class NoTabsTitleControl extends TitleControl {
private redraw(): void {
const editor = withNullAsUndefined(this.group.activeEditor);

const isEditorPinned = this.group.activeEditor ? this.group.isPinned(this.group.activeEditor) : false;
const isEditorPinned = editor ? this.group.isPinned(editor) : false;
const isGroupActive = this.accessor.activeGroup === this.group;

this.activeLabel = { editor, pinned: isEditorPinned };
Expand Down

0 comments on commit 4c467c1

Please sign in to comment.