By default, when you expand or collapse a method or a code region in Visual Studio, this action is pushed on the undo stack. It ruins any normal code editing cycle – you do text changes, browse code doing folding/unfolding and now your undo stack is full of unrelated outlining operations, need to press Ctrl+Z multiple times to undo a change.
I’ve created the new Disable Outlining Undo extension that excludes expanding and collapsing operations from recording to the undo/redo stack in Visual Studio 2017/2019.