views:

40

answers:

2

Not sure if anyone else has come across this yet. I like to use a an indent of 2 or 3 and not the default 4 for visual studio because i find my code runs a bit far to the right and I prefer to not code over column 80 for readability's sake. When I change the indent and tabs to 2 using tools >> options >> Text Editor >> C# >> tabs and also set it to "keep tabs" then new classes created are fine. BUT if I create a new ASPX page with a code behind page, the code behind page's initial code keeps a 4 space indent although i specified 2. I have to format the document (a quick ctrl e, d) but it is still irritating. Anyone else come across this?

A: 

Try setting Tools -> Options -> Text Editor -> All Languages -> Tabs instead of C# -> Tabs.

Alternatively try a different font or try breaking your code up into smaller pieces by extracting methods via the Visual Studio built-in refactoring tools, etc.

Mark
A: 

Just had a look now. All languages are already set. I could break up my code further but don't want it to get into spaghetti code. I like my methods do a logical unit of work :)

uriDium