ispiro
ispiro

Reputation: 27693

Prevent Visual Studio from highlighting similar words

If I highlight a variable named "abc", and I also have a method named "abc1", the abc in abc1 get lightly-highlighted.

enter image description here

I tried preventing that by unchecking Tools > Options > Text Editor > C# > Advanced > Highlighting > Highlight related keywords under cursor [what does that even mean?] but to no avail.

Is there a way to prevent that?

(VS version 17.4.2)

Upvotes: 1

Views: 1054

Answers (1)

pfx
pfx

Reputation: 23274

This is the Selection Match Highlighting feature.

The selection match highlighting is a new feature to help you quickly find additional occurrences of a string in the document you’re editing.

When it’s checked, any time you select something in your editor, anywhere else that exact string occurs will be subtly highlighted both in the editor and in the scrollbar.

To disable, uncheck the "Show selection matches" checkbox

Tools > Options > Text Editor > General > Show selection matches

enter image description here

Upvotes: 6

Related Questions