remove overflow action when there are no overflows

This commit is contained in:
Sandeep Somavarapu 2021-03-29 10:26:44 +02:00
parent 44f89fc13c
commit e96e70d59e

View file

@ -6,7 +6,6 @@
import { localize } from 'vs/nls';
import { IAction, toAction } from 'vs/base/common/actions';
import { illegalArgument } from 'vs/base/common/errors';
import { equals } from 'vs/base/common/arrays';
import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { IBadge } from 'vs/workbench/services/activity/common/activity';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@ -536,10 +535,8 @@ export class CompositeBar extends Widget implements ICompositeBar {
compositesToShow.length ? compositesToShow.splice(compositesToShow.length - 2, 1) : compositesToShow.pop();
}
const visibleCompositesChange = !equals(compositesToShow, this.visibleComposites);
// Pull out overflow action if there is a composite change so that we can add it to the end later
if (this.compositeOverflowAction && visibleCompositesChange) {
// Remove the overflow action if there are no overflows
if (!overflows && this.compositeOverflowAction) {
compositeSwitcherBar.pull(compositeSwitcherBar.length() - 1);
this.compositeOverflowAction.dispose();