Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop visual studio from auto expanding code regions?

As the title describes, how I could stop visual studio from auto-expand code region? I'm using visual studio on a C++ project.

For example, sometimes when I delete some part of my code it unfolds a lot of regions far away up from where the line was deleted.

This behavior also happens sometimes when I'm scrolling, from nothing it expands the region.

I saw there's an option on edit > outlining > stop outlining

enter image description here

But this disables all kind of code folding, I just want to stop visual studio herself from auto-expanding any kind of code.

This is frustrating, it happens a lot of times and I need to stop what I'm doing to fold everything again.

like image 764
Cesar Avatar asked Oct 25 '25 17:10

Cesar


1 Answers

I know this is an old post, but still wanted to add my additional comments, for others like me that came looking for a solution.

I have had this issue of seemingly randomly expanding regions and non-regioned Subs/Functions for YEARS now...

Unfortunately, to this day, there still is NO solution or fix.

It happens randomly when Pasting/Cutting/Deleting code lines/blocks, which causes Visual Studio to re-evaluate the entire code, "solving problems" with how the code is displayed, thus resulting in the collapsed code blocks expanding.

I have just created another Microsoft Developer Community Issue Report about this issue. I hope this time Microsoft will take it more seriously, because it is really impacting my ability to finish projects....

Here is the link to the issue report: https://developercommunity.visualstudio.com/t/Collapsed-regions-keep-randomly-expandin/10821359

like image 56
JohnVK Avatar answered Oct 28 '25 16:10

JohnVK