Improvements to VS 2010 Text Selection

Improvements to VS 2010 Text Selection

Rate This
  • Comments 40

Brittany Behrens Brittany Behrens – Program Manager, Visual Studio Editor Team
Short Bio: I’m Brittany, a Program Manager on the Visual Studio Editor team.  Some of you may recognize me from Connect bugs or as the main voice of @VSEditor on Twitter, and I’m responsible for a variety of Editor features.  I love hearing from customers, so please let me know what you think!

 

As you may have noticed, text selection in Visual Studio 2010 is a bit more colorful than in previous versions.  In VS 2008 and earlier, selected text had a single foreground color and a single background color, usually white text on a navy blue background by default.  However, we have made substantial changes and improvements to the Visual Studio Editor for this release, including the new for VS 2010 ability to compose different display layers together. One of the many benefits of this is that we can combine the background color for selection with the foreground colors for a variety of other display items (plain text, keywords, comments, etc.) to show syntax coloring not only for unselected text but now for selected text as well, which we think makes selected code easier to understand.  Check out this side-by-side comparison to see the difference:

Selection in Visual Studio 2008 vs. Visual Studio 2010

In light of this new mini-feature, we intentionally disabled the foreground color option for Selected Text in Tools->Options->Environment->Fonts and Colors.  Because selected text doesn’t have a single foreground color but instead retains whatever syntax coloring it had when not selected, an option for selected text foreground color doesn’t make sense for Visual Studio 2010.  For Beta2, the Tools->Options preview for Selected Text always shows the VS 2008-style white foreground color, which we realize can be confusing.  We’ve already updated this internally so that for VS 2010 RTM, the Item Foreground Color dropdown and the Sample preview box will show your default Plain Text foreground color instead of white, giving you a more accurate idea of what selected text will look like in the editor.

This is one of many improvements we were able to make by moving the editor to WPF – hope you enjoy it!

Brittany Behrens
Program Manager, Visual Studio Editor Team

Leave a Comment
  • Please add 1 and 3 and type the answer here:
  • Post
  • this is great improvement :-)

  • Cool.

    VS2010 is already my default IDE.

  • This is a nice feature ! I like it :-)

  • I like it :)

  • It's quite nice. I also very much appreciate the removal of the gradient-shaded selection from Beta 1.

  • It's very nice and like it!

    Less contrast between foreground and background color and also selection syntax coloring provide better readability and reduce eyestrain.

    I'm expecting more VS posts to come.

  • VS2010 Ver.

  • Oh wow!

    I was in search of the same....

    Thanks...

  • Hey Brittany,

    Love box selection as one of the selection improvements, but I think I found a problem (maybe bug).  It has to do with HTML auto-completion of tags when using multi-line editing.  Details with pic here: http://theycallmemrjames.blogspot.com/2009/12/bug-or-implementation-problem.html

    Cheers,

    -James

  • I would massively recommend to add an option for the old (pre VS 2010) behavior. I'm presenting at various venues around the world (including several Microsoft events, like TechEd US and TechEd Europe) and this dramatically decreases readability on a big screen.

    Cheers,

    -Ingo

  • Hmmm ... after playing with it for a bit more, I think there are some combination in the new model which are actually considerably more readable on a projected screen than my previous favorite of black text on yellow. However: black-on-yellow for selection was a color scheme which always also worked on low-quality projectors in partially-lit rooms ... I'm not 100% sure if the new "dimmed yellow" will be easily visible on all types of projectors ...

  • Hi,

    Have to agree with Ingo here. This could make VS2010 almost unusable for presentations. I thought it was a bug when I came across it. While the colors you've chosen are ok for a user at a computer, they are pathetic for viewing in a presentation. It's usually the first thing we modify when setting up a system to present from.

    Regards,

    Greg

  • I have to agree with Ingo and Greg. I'll have to start copying code from VS to Notepad so people can see it when projected. Won't THAT be impressive??!!!??

  • As a person who presents code examples to clients a lot (over 70 times last year) I feel the old option is worth keeping - unless there is some compelling reason to block it.

    I'm not sure why, when WPF is used, the option had to be blocked?

    I feed the contrast possible when one can change the selected text foreground color is a good tool for adapting to the varied lighting and projectors one conmes accross out there.

    I'm going to keep playing with the new font and color options - maybe I'll find a way to dial in what I want.

    Thanks for listening.

    Mike McIntyre MVP Visual Basic

  • I wrote an extension that recreates the old behavior, which you can download from the Visual Studio Gallery here: http://visualstudiogallery.msdn.microsoft.com/en-us/7ed8bf5b-f62b-477b-b221-ab8f7216ee36

    After you install it, the default selection foreground color will be white.  To change it, go to Tools->Options->Environment->Fonts and Colors, find the "Selection Foreground" item (towards the bottom of the list, sorted alphabetically), and change the foreground color of that.

Page 1 of 3 (40 items) 123