Visual Studio 2013 Preview: Enhanced Scroll Bar

Visual Studio 2013 has another great new feature: enhanced scroll bar functionality. The new scroll bar will show cursor location, breakpoints, and much more! Let’s take a look.

5-17-2012 12-51-16 PM

 

 

Power Tools

Before we begin I want to address where some of the new features in VS2013 are coming from. In Visual Studio 2013 many of the new features we put into the product were actually introduced via the Productivity Power Tools for Visual Studio 2012. This is an ongoing trend and you will see that many of the new features from future versions will come directly from the Power Tools. If you are still on 2012 you can get a lot of the newest functionality by installing the Visual Studio 2012 Power Tools which can be found here:

http://visualstudiogallery.msdn.microsoft.com/3a96a4dc-ba9c-4589-92c5-640e07332afd

 

 

Scroll Bar Options

To really get a handle on the new scroll bar functionality the first thing you should do is Right Click on the vertical scroll bar and choose Scroll Bar Options:

5-17-2012 11-57-37 AM

 

You will see several settings that can be modified:

5-17-2012 12-00-10 PM

(NOTE: You can also get to this area by going to Tools | Options | Text Editor | All Languages | Scroll Bars)

 

 

Show Scroll Bar

5-17-2012 12-08-43 PM

The first two options are pretty self-explanatory they will allow you to show or hide the scroll bars. For the most part you will leave these checked unless you have some special reason not to have them visible. 

 

Display

5-17-2012 12-12-18 PM

The Display area allows you to turn on annotations that will show special items throughout the entire document within the scroll bar. This allows you, at a glance, to see where things like breakpoints and bookmarks are. We will look at these in the order you are most likely to encounter them but here is an example of the vertical scroll bar with annotations in it:

5-17-2012 12-32-50 PM

 

 

Show Caret Position

5-17-2012 12-17-37 PM

The first annotation you will most likely encounter is the caret position indicator. It simply shows the current position of the cursor with a blue line in the scroll bar.

 

 

Show Changes

5-17-2012 12-28-50 PM

If you missed my blog post a couple of years ago on tracking changes in the editor, this is a good time to read it. You can find the post here:

http://blogs.msdn.com/b/zainnab/archive/2010/04/14/track-changes-in-the-editor-vstipedit0048.aspx

 

The Show Changes option simply shows the changes within it so you can see modifications at a glance for the entire document.

 

 

Show Marks

This options is fairly broad and covers several types of marks that can appear in code. Most notably this will show breakpoints:

5-17-2012 12-42-29 PM

 

Additionally, this will also show things like Bookmarks:

5-17-2012 12-44-01 PM

 

 

Show Errors

The final indicator is arguably one of the most important. It shows any syntax errors the editor is aware of:

5-17-2012 12-46-58 PM

 

This let’s you quickly see where there are errors that need to be fixed before you compile your code.

 

 

Behavior

There are two behavior options for the vertical scroll bar: bar mode and map mode. So far everything we have seen is the traditional bar mode for the scroll bar. Now we will switch to map mode:

5-17-2012 12-55-12 PM

 

Map mode essentially turns your vertical scroll bar from this:

5-17-2012 12-56-48 PM

 

To this:

5-17-2012 12-57-38 PM

 

 

Source Overview

Map mode is miniature look at your document so you can quickly get a feel for your code. There are four options for source overview when using map mode. I’ll show examples of the four views below. Of these the Off setting will be the most confusing until you see the Preview Tooltip in action so be patient.

 

Wide

5-17-2012 12-57-38 PM

 

Medium

5-17-2012 12-59-53 PM

 

Narrow

5-17-2012 1-00-50 PM

 

Off

5-17-2012 1-02-23 PM

 

 

Preview Tooltip

Regardless of which map mode view you use there is also an option to have the Preview Tooltip. Simply put your mouse pointer over any part of the vertical scroll bar and you will get a preview of the code at that position in the document:

5-17-2012 1-09-33 PM

 

Annotations

All annotations previously mentioned also show up in map mode:

5-17-2012 1-12-45 PM

 

 

Go to a Specific Location on the Scroll Bar

You basically have two options when you want to go to a specific location on the scroll bar. Let’s examine both ways.

 

Left Click

As long as you are in map mode:

5-17-2012 2-39-51 AM

 

You can simply LEFT CLICK any area on the scroll bar and you will jump to that location:

5-17-2012 2-41-10 AM

 

For this reason, I suggest, even if you don’t want the map, that you at least use map mode set to Off to get this functionality so you can quickly move around using the scroll bar:

5-17-2012 2-44-42 AM

 

 

Scroll Here

Now that you have a solid base level of knowledge for this feature there is one more important item I want to show you: Scroll Here. If you find any place that is interesting to you in the vertical scroll bar and want to quickly go to that location you can simply Right Click the location and choose Scroll Here:

5-17-2012 10-12-17 PM

 

The new location will come into view so you can begin looking at the code:

5-17-2012 10-13-50 PM

 

 

Finally

The enhanced vertical scroll bar is a great tool for developers to quickly see places of interest and to examine those locations. Try this feature out and see if you like it as much as I do. :)