Visual Studio 2013缩进在编写时不起作用 [英] Visual Studio 2013 Indentation Not Working While Writing
问题描述
我有这样的代码:
class Myclass
{
}
我现在想添加一些代码,例如一个方法.我在}之后走,然后按回车键,期望得到它(|是光标所在的位置):
I now want to add some code, e.g. a method. I go right after the } and press enter expecting to get this (| is the place of the cursor):
class Myclass
{
|
}
但是我得到了:
class Myclass
{
|
}
如果我现在输入一个方法,它将保持这样:
If I now enter a method it stays like this:
class Myclass
{
public void A()
{ }
}
我的缩进配置是正确的,因为一旦按Ctrl + K,D就会固定.我还检查了选项->文本编辑器-> C#->格式->缩进,并检查了缩进块内容".
My configuration for indentation is correct because once I press Ctrl+K, D it gets fixed. Also I checked Options -> Text Editor -> C# -> Formatting -> Indentation and "Indent block contents" is checked.
这是在带有Resharper 8.1的Visual Studio 2013上发生的.我暂时暂停了Resharper,没有任何区别.在同一台计算机上,我具有带有Resharper的Visual Studio 2012,并且可以正常工作.
This is happening on Visual Studio 2013 with Resharper 8.1. I suspended Resharper temporarily and there is no difference. On the same machine I have Visual Studio 2012 with Resharper and it works normally.
有人知道在写过程中必须更改什么配置才能使缩进工作吗?
Does anyone know what configuration has to be changed to have the indentation work during writing?
推荐答案
我发现搞砸了这个设置:它是选项->文本编辑器->所有语言->制表符->缩进.我将其设置为阻止",它应该很聪明
I found the setting that is messing this up: it is Options->Text Editor->All Languages->Tabs->Indenting. I had it set to Block and it should be Smart
这篇关于Visual Studio 2013缩进在编写时不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!