How to stop Visual Studio 2008 collapsing white space between operands and operator?
For example I like to keep my rig开发者_如何学Goht hand operands left aligned in the same col:
int a = 1;
string aLongVaribleName = "test";
But if I touch the code such as adding the ';' at the end VS collapses it to:
int a = 1;
string aLongVaribleName = "test";
Is there any option to stop VS doing this?
Tools > Options > TextEditor > C# > Formatting
Go to Tools > Options...Then go to Text Editor > C# > Formatting > General. There are 3 auto format options there.
There is a VB macro for VS03/05, should be good for 08 also: http://omegacoder.com/?p=8
Bit off topic, as for VS2010, you can use either:
Productivity PowerToy: http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef/view/Reviews/12
OR
NoahRic's AlignAssignment: https://github.com/noahric/AlignAssignments
精彩评论