Visual Studio 2010的code格式的.CSHTML - 不正确的缩进 [英] Visual Studio 2010 Code Formatting in .CSHTML - Improper Indentation

查看:841
本文介绍了Visual Studio 2010的code格式的.CSHTML - 不正确的缩进的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

pretty的简单的问题来解释:在Visual Studio 2010 SP1中,我看到奇怪的缩进问题,用大括号使用剃刀时,

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

下面是它的外观:

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

这就是出来后,我做了CTRL + K,D进行格式化。任何人有这个问题?这是怎么回事?

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

推荐答案

这是在编辑器中一个已知的bug。

This is a known bug in the editor.

要解决这个问题,选择插入空格,而不是保持标签的选项,文本编辑器,HTML。

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

这篇关于Visual Studio 2010的code格式的.CSHTML - 不正确的缩进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆