open editors: visible take groups into account also

#6919
This commit is contained in:
isidor
2016-05-31 10:58:00 +02:00
parent 5988be9889
commit 838ead773c

View File

@@ -245,7 +245,11 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView {
}
private static computeExpandedBodySize(model: IEditorStacksModel, visibleOpenEditors = OpenEditorsView.DEFAULT_VISIBLE_OPEN_EDITORS, dynamicHeight = OpenEditorsView.DEFAULT_DYNAMIC_HEIGHT): number {
const entryCount = model.groups.reduce((sum, group) => sum + group.count, 0);
let entryCount = model.groups.reduce((sum, group) => sum + group.count, 0);
// We only show the group labels if there is more than 1 group
if (model.groups.length > 1) {
entryCount += model.groups.length;
}
let itemsToShow: number;
if (dynamicHeight) {
@@ -253,10 +257,6 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView {
} else {
itemsToShow = Math.max(visibleOpenEditors, 1);
}
// We only show the group labels if there is more than 1 group
if (model.groups.length > 1) {
itemsToShow += model.groups.length;
}
return itemsToShow * Renderer.ITEM_HEIGHT;
}