Click here to Skip to main content
15,867,686 members
Articles / Visual Studio

Color Indicator for Code Changes – Track Changes in Visual Studio 2010

Rate me:
Please Sign up or sign in to vote.
4.97/5 (9 votes)
14 Sep 2010CPOL3 min read 37.6K   3   17
Track Changes in Visual Studio 2010

“Track Change” is one of the best interesting features in Visual Studio which indicates the code changes with a color indicator at the beginning of the line. Generally we know about the two color indicators “Green” and “Yellow” which are used for indicating the color change till VS 2008. Along with those, VS 2010 introduced another new color “Orange” which indicates some additional track change for undoing file after save. In this blog post, I am going to explain how those color indicators helps developers to track the code changes.

In Visual Studio 2010, there are three color indicators:

TrackChange_Green Green color indicates the lines which you have edited before your last save. Save again the file and green mark will disappear.

TrackChange1

TrackChange_Yellow Yellow color indicates the lines which you have edited since the last save of that file. Yellow becomes Green after saving of the file. Once you close the file, that indication disappears.

TrackChange2

TrackChange_Orange This color indication has been newly introduced in VS 2010. This color will come when the user does an undo after a save operation for that current file. Orange color indicates that current changed line is different from the saved version of the file.

TrackChange3

How to Enable / Disable Track Change Features?

To enable or disable the “Track Change” features, Goto Tools > Options > TextEditor. In General section, you can check or uncheck the “Track Change” option.

TrackChange_Enabled

Key Note: While you are using “Track Change” option, you have to select “Selection Margin” display option otherwise, “Track Change” won’t work.

TrackChange_Enabled_2

One Quick Flow of “Track Change”

You have opened one code file in Visual Studio 2010 which has the below lines of code. By default, there is no color indicator with line number.

example1

Now, you have started editing the file Yellow indicator shows, you have made changes on those lines.

example2

When you are done with your changes, Save the file. Green indicator shows, all of your changes has been saved.

example3

Now, you have undone the files after save, orange indicator says that the lines are different than the save version. It means that you have changed something on the original file, saved it and again undo it.

example4

When you first undoing it, it will be showing as “Yellow”, which means you are editing with this line, but when you are done with all the undoing for that line which is different, the saved version color becomes “Orange”. This means, it is different from the saved version.

To get a clear idea, just compare the below two images. Yes, all the orange color marked lines are similar to the default version image.

example1

Default Code image
example4

“Orange” Indicator Image

But, the saved version of the file is:

example3

Similarly, this track change also works for config files.

Summary

“Track Change” is one very useful feature in Visual Studio, by which you can see where you have edited / saved on a file for that current VS IDE state. Green color indicates the lines which you have edited before your last save. Yellow color indicates the lines which you have edited since the last save of that file. Orange color indicates that the current changed line is different from the saved version of the file.

If you want to know more about editor setting options, please check the below link:

To know more about the more useful Visual Studio Tips and Trick, please follow Sara Ford’s Blog.

Hope this will help you!

Thanks!


Filed under: Tips and Tricks, Visual Studio, Visual Studio 2010

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
India India
.NET Consultant | Former Microsoft MVP - ASP.NET | CodeProject MVP, Mentor, Insiders| Technology Evangelist | Author | Speaker | Geek | Blogger | Husband

Blog : http://abhijitjana.net
Web Site : http://dailydotnettips.com
Twitter : @AbhijitJana
My Kinect Book : Kinect for Windows SDK Programming Guide

Comments and Discussions

 
GeneralMy vote of 4 Pin
rahman_tanzilur0113-Jan-13 11:03
rahman_tanzilur0113-Jan-13 11:03 
GeneralMy vote of 5 Pin
Brij15-Sep-10 1:05
mentorBrij15-Sep-10 1:05 
GeneralRe: My vote of 5 Pin
Abhijit Jana15-Sep-10 5:38
professionalAbhijit Jana15-Sep-10 5:38 
GeneralAnother Excellent One..! Pin
sashidhar14-Sep-10 7:05
sashidhar14-Sep-10 7:05 
GeneralRe: Another Excellent One..! Pin
Abhijit Jana14-Sep-10 8:13
professionalAbhijit Jana14-Sep-10 8:13 
GeneralMy vote of 5 Pin
Abhishek Sur14-Sep-10 2:48
professionalAbhishek Sur14-Sep-10 2:48 
Good work .. Cheers.
GeneralRe: My vote of 5 Pin
Abhijit Jana14-Sep-10 4:44
professionalAbhijit Jana14-Sep-10 4:44 
GeneralMy vote of 5 Pin
mohangbits14-Sep-10 1:47
mohangbits14-Sep-10 1:47 
GeneralRe: My vote of 5 Pin
Abhijit Jana14-Sep-10 4:45
professionalAbhijit Jana14-Sep-10 4:45 
GeneralMy vote of 5 Pin
mohangbits14-Sep-10 1:47
mohangbits14-Sep-10 1:47 
GeneralRe: My vote of 5 Pin
Abhijit Jana14-Sep-10 4:45
professionalAbhijit Jana14-Sep-10 4:45 
GeneralMy vote of 5 Pin
Sandesh M Patil14-Sep-10 1:32
Sandesh M Patil14-Sep-10 1:32 
AnswerRe: My vote of 5 Pin
Kunal Chowdhury «IN»14-Sep-10 2:16
professionalKunal Chowdhury «IN»14-Sep-10 2:16 
GeneralRe: My vote of 5 Pin
Sandesh M Patil14-Sep-10 2:27
Sandesh M Patil14-Sep-10 2:27 
GeneralRe: My vote of 5 Pin
Abhijit Jana14-Sep-10 4:45
professionalAbhijit Jana14-Sep-10 4:45 
GeneralMy vote of 5 Pin
Kunal Chowdhury «IN»14-Sep-10 1:22
professionalKunal Chowdhury «IN»14-Sep-10 1:22 
GeneralRe: My vote of 5 Pin
Abhijit Jana14-Sep-10 4:44
professionalAbhijit Jana14-Sep-10 4:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.