Visual Studio 2010 Code Formatting in .CSHTML - Im

2019-03-18 06:52发布

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?

1条回答
太酷不给撩
2楼-- · 2019-03-18 07:19

This is a known bug in the editor.

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

查看更多
登录 后发表回答