markmnl
markmnl

Reputation: 11426

How to stop Visual Studio 2008 collapsing white space between operands and operator?

For example I like to keep my right 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?

Upvotes: 2

Views: 279

Answers (3)

jackyang
jackyang

Reputation: 31

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

Upvotes: 0

Glenn Ferrie
Glenn Ferrie

Reputation: 10400

Go to Tools > Options...Then go to Text Editor > C# > Formatting > General. There are 3 auto format options there.

Upvotes: 1

Jay
Jay

Reputation: 57939

Tools > Options > TextEditor > C# > Formatting

options dialog

Upvotes: 1

Related Questions