开发者

Visual Studio 2010 Code Formatting in .CSHTML - Improper Indentation

Pretty simple problem to explain: In开发者_开发百科 Visual Studio 2010 SP1, I'm seeing weird indentation issues with braces when using Razor.

Here's how it looks:

<div>
    <div>
        <div>
            <div>
                @if (true)
        {
                    <b>Hi</b> 
       }
            </div>
        </div>
    </div>
</div>

That's what comes out after I do a CTRL + K, D to format it. Anyone else have this issue? What's the deal?


This is a known bug in the editor.

To fix it, select Insert Spaces rather than Keep Tabs in Options, Text Editor, HTML.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜