There\'s something really annoying in Visual Studio : when I expand or collapse a method or code region, this action is pushed on the undo stack. So if I edit some code in a met
First, it seems that not all outlining operations are recorded in the undo/redo stack.
So, as far as I know, it is not possible to avoid the recording of Toggle operations in the undo/redo stack in Visual Studio 2008.
The only option you have it to enable/disable outlining for each source type. For C#, outlining can be enabled/disabled in Tools → Options → Text Editor → C# → Advanced with the Enter outlining mode when files open checkbox.