Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Issue: Razor code formatting is broken when using tabs in VS2012 MVC 4 [398]

$
0
0
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: @johnmblack - As you can tell from the bug status it is planned to be addressed in our next release. We already know how to fix the formatting when you format using Ctrl-K-D, and we are looking at the auto formatting issue as well.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>