Timothy G.
Timothy G.

Reputation: 9145

How to change the colors of the modified lines indicator in version 17.2?

I updated Visual Studio 2022 Preview to version 17.2 Preview 6.0, and after doing so, the colors and appearance of the changed lines indicators are "modernized" (similar to Visual Studio Codes) to be blue for modified lines (instead of yellow). There are also some other appearance changes, such as an unfilled green bar for added lines that aren't saved (which I think previously would also just be a yellow bar).

Bars

In this screenshot, the circled blue line is "Modified" (saved) which previously would be a green line I believe. The circled unfilled green bar is "Added - Not Saved".

I checked the preview patch notes, but nothing seems to point out what changes this. What is the setting for changing the behavior of these indicators?

Upvotes: 5

Views: 2670

Answers (2)

Timothy G.
Timothy G.

Reputation: 9145

Update:

My other answer on another post explains how to disable this on Visual Studio 17.9.0, which added the ability to toggle between Git Changes and File Changes:

Go to Tools → Options → Text Editor → General and change the "Tracking Mode" dropdown to either be Git Changes or File Changes:

tracking mode option in settings


Original Answer:

This is a part of the "Line Staging" feature, which is actually tied to Git. In update 17.2 of Visual Studio, the feature was turned on by default. The patch notes do mention this feature, but it's not readily obvious from the patch notes alone that this feature is what changed this.

Git Line Staging

By unchecking this checkbox and restarting Visual Studio, you can get back the original color scheme of the change indicators. Some of the other appearance changes do not revert back however. The changed line indicator is now an unfilled yellow bar (instead of solid) that turns to a solid green bar when saved. Obviously, you will also lose the ability to use any of the other features introduced with this feature when you uncheck this box.

It appears that there are also individual color settings that you can change if you want to keep this feature enabled but try and maintain the original color scheme of the indicators.

Upvotes: 10

Andrei Despinoiu
Andrei Despinoiu

Reputation: 620

Used to be a "preview" feature but it was moved to:

Tools - Options - Text Editor - General - Tracking mode - change it from "Git changes" to "File changes"

At least that's where it is currently in v17.9.0.

enter image description here

This only becomes an issue once you start using the in-built Git client. It changes behaviour without even asking you.

Upvotes: 0

Related Questions