运行 Visual Studio Community 2015(但在早期版本中也看到了这个问题),当我编辑 HTML 文件时,当我按下回车键转到下一行时,我刚刚离开的行被移动了向左,去除缩进。 Ctrl-K,D
再次重新格式化该行。很烦人?
输入前:
输入后:
Identing 在 Text Editor|HTML|Tabs
以及 Text Editor|HTML (Web Forms)|Tabs
中设置为 Smart
似乎是一个错误,为什么有人需要这种行为?
最佳答案
解决方案:
我突然想到:ReSharper?是的,我尝试在 Options|ReSharper 中暂停 ReSharper,奇怪的行为消失了。
经过反复试验,我找到了选项:ReSharper|Options
和Code Editing|HTML|Formatting Style|Do not indent children of
。
显然,ReSharper 不希望 body 标签的子标签缩进。我不同意。从设置中删除“ body ”,现在一切都是幸福的。
关于html - Visual Studio HTML 格式化程序 : Hitting enter removes all indents in the previous line,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37364415/