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

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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With