New ReSharper plugin - bringing the preview tab back

by Matt 1. February 2013 03:12

ReSharper 7.0 brought full support for Visual Studio 2012. One of my favourite little features was preview tab integration.

The preview tab is reusable, rather than the normal, persistent editor tabs. It displays one file at a time, and the content is replaced when a new file is navigated to. This is a great way to reduce the number of open tabs in the editor, especially if you’re just browsing a codebase. If you want to edit a file, just start typing, and it seamlessly becomes a normal editor tab.

Also, it’s a nice purple colour.

The purpley goodness of the preview tab

ReSharper 7.1 changed the behaviour, using the preview tab much less, and now normal editor tabs abound and multiply.

I’ve taken this rather personally. It’s messed up my workflow. I’m back to the bad old days of VS 2010, all too often declaring Document Bankruptcy and closing all windows, even those I’m editing on.

Unsurprisingly, I don’t agree with the arguments for the change – primarily, that if you’re navigating directly to a type or symbol, it’s so you can edit the file.

That’s not how I work. I read code as much as I write code, and tend to have to navigate to the right place before I can change anything. That can open more files than I actually need to work. The preview tab is brilliant for this – I get to read the file and navigate away without it cluttering up the editor. If I want to edit it, I simply start typing. And if I need to get back to a file that’s been replaced? Use ReSharper’s Recent Files popup, and bob’s yer uncle (you don’t use ctrl+enter, do you?)

ReSharper's recent files popup window

Fortunately, as is the way with ReSharper, it’s extensible and can be (ahem) fixed. So, if you want to get back to purple preview tab perfection, here’s a nice little plugin that forces all navigation to go through the preview tab. Source and binaries are on GitHub, and you can find the download link on the Release Notes page.

(ReSharper 7.1’s use, or lack of use, of the preview tab isn’t arbitrary. Direct navigation opens a normal editor tab. Browsing from a tool window, by hitting enter, or ctrl+alt+up/down to browse previous/next occurrence uses the preview tab. I just happen to want direct navigation to use the preview tab, too)

Tags: , , ,

Rel=Me

Month List

RecentComments

Comment RSS