Scroll to expand document tabs
When you have lots of tabs open in Visual Studio, your horizontal screen resolution determines how many fit in the document tab well. The remaining document tabs are hidden unless you configure Visual Studio to display tabs in multiple rows. Alternatively, you could switch your tab layout to vertical tabs instead of the default horizontal layout. Vertical tabs, of course, isn’t the answer for everyone, and it’s not what we’re going to talk about in today’s blog post!
Going back to multiple tab rows – enabling this feature and having multiple rows of tabs open will have an impact on your available coding space. What happens if you’re a fan of the horizontal tab layout and want an easier way to get an overview of all your open documents without giving up space in your code editor? Continue reading to learn how we addressed this issue.
You might already be familiar with the experience of hovering over tabs and using the mouse wheel to scroll through them in some browsers and other applications. The Custom Document Well extension brought this feature to Visual Studio in older versions. Changes in Visual studio’s architecture led to the discontinuation of this years ago. We didn’t bring back mouse wheel scrolling in that form after this change due to several reasons, one of the most predominant ones being that the feature had to be reimagined to properly function under the new architecture.
We noticed that a feature request for using the mouse scroll wheel had been gaining steam. In response, we decided to do an experiment to come up with a solution. The experiment was a success! Its capabilities have been built into Visual Studio 2022 starting in version 17.9 Preview 1.
How it works
The first time you have enough tabs open to overflow the tab well, a tooltip shows up in the document tab well. This tip indicates that the mouse scroll wheel can be used to switch between single and multiple tab row styles. If you don’t want to use this feature, just dismiss the notification, and carry on as usual.
If you’d like to give it a try, scroll the mouse wheel down. You’ll notice that Visual Studio will then organize your tabs in multiple rows. This enables the “Show tabs in multiple rows” setting in Tools > Options > Environment > Tabs and Windows and results in an expansion of the tab well to show all open document tabs, making it easy to find any open file.
You can switch back from multiple tab rows by scrolling the mouse wheel up. This collapses the tab well to a single row of tabs and disables the “Show tabs in multiple rows” setting in Tools > Options.
Figure 3: A video demonstrating switching between tab row styles
Note that if you have a tab selected in a row other than the topmost one when you switch back to the single row view, Visual Studio may displace one or more of your least used tabs in the single row to make room to move your selected tab to the rightmost position of the single row view.
To try this out, download or update to the latest preview version of Visual Studio (v17.9 Preview 1 or newer). As always, your feedback is important to us, and we’d love to hear what you think. Please share your thoughts on Developer Community!