When using "Keep tabs" instead of the default "Insert spaces", and running "Fomat document" (CTRL-E, CTRL-D) on in a .cshtml file with razor code any ifs inside other markup gets "mangled". I've attached a screenshot with a comparison of space and tab formatting.
Repro:
In Visual Studio 2012 (I'm using premium), create a new ASP.NET MVC 4 project (using the default web site template).
Open "Tools"->"Options"->"Text Editor"->"All Languages"->"Tabs" and set "Keep tabs" instead of "Insert spaces".
Open any view (.cshtml) and insert:
<div>
@if(true) {
}
</div>
Run format document (CTRL-E, CTRL-D).
Comments: I've the same issue in vs2012. It's even more strange, because it's being reproduced with space's indents.
Repro:
In Visual Studio 2012 (I'm using premium), create a new ASP.NET MVC 4 project (using the default web site template).
Open "Tools"->"Options"->"Text Editor"->"All Languages"->"Tabs" and set "Keep tabs" instead of "Insert spaces".
Open any view (.cshtml) and insert:
<div>
@if(true) {
}
</div>
Run format document (CTRL-E, CTRL-D).
Comments: I've the same issue in vs2012. It's even more strange, because it's being reproduced with space's indents.