From a6fa62809e6e47a39867f5811653cdad3f4343e9 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 19 Feb 2021 11:48:05 +0100 Subject: [PATCH] tabs wrap - allow for up to 1px overlap of last tab to action toolbar before disabling wrapping tabs (fix #116385) --- .../workbench/browser/parts/editor/tabsTitleControl.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index 0f5e0e29230..26ec8b58880 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -1415,7 +1415,14 @@ export class TabsTitleControl extends TitleControl { return true; // no tab always fits } - return lastTab.offsetWidth <= (dimensions.available.width - editorToolbarContainer.offsetWidth); + const lastTabOverlapWithToolbarWidth = lastTab.offsetWidth + editorToolbarContainer.offsetWidth - dimensions.available.width; + if (lastTabOverlapWithToolbarWidth > 1) { + // Allow for slight rounding errors related to zooming here + // https://github.com/microsoft/vscode/issues/116385 + return false; + } + + return true; }; // If tabs wrap or should start to wrap (when width exceeds visible width) -- GitLab