diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index 6d1714379a55f5a34a6199b5cbaaece44d0ddd26..c67400b89589d56eb390678b1bb732018fbf9b2c 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -549,6 +549,14 @@ export class TabsTitleControl extends TitleControl { const visibleContainerWidth = this.tabsContainer.offsetWidth; const totalContainerWidth = this.tabsContainer.scrollWidth; + let activeTabPosX: number; + let activeTabWidth: number; + + if (!this.blockRevealActiveTab) { + activeTabPosX = this.activeTab.offsetLeft; + activeTabWidth = this.activeTab.offsetWidth; + } + // Update scrollbar this.scrollbar.setScrollDimensions({ width: visibleContainerWidth, @@ -563,8 +571,6 @@ export class TabsTitleControl extends TitleControl { // Reveal the active one const containerScrollPosX = this.scrollbar.getScrollPosition().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