From 13248eab78810381578ab9260b5e040c9c90ea27 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 14 Jun 2016 18:21:39 +0200 Subject: [PATCH] Resizing groups with multiple editors causes tab header flashing (fixes #7665) --- src/vs/workbench/browser/parts/editor/tabsTitleControl.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index 9f73c4b6e99..876cdbd7fe5 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -330,9 +330,11 @@ export class TabsTitleControl extends TitleControl { const containerScrollPosX = this.tabsContainer.scrollLeft; const activeTabPosX = this.activeTab.offsetLeft; const activeTabWidth = this.activeTab.offsetWidth; + const activeTabFits = activeTabWidth <= visibleContainerWidth; // Tab is overflowing to the right: Scroll minimally until the element is fully visible to the right - if (containerScrollPosX + visibleContainerWidth < activeTabPosX + activeTabWidth) { + // Note: only try to do this if we actually have enough width to give to show the tab fully! + if (activeTabFits && containerScrollPosX + visibleContainerWidth < activeTabPosX + activeTabWidth) { this.scrollbar.updateState({ scrollLeft: containerScrollPosX + ((activeTabPosX + activeTabWidth) /* right corner of tab */ - (containerScrollPosX + visibleContainerWidth) /* right corner of view port */) });