I'm using Visual Studio 2015. Whenever I add any kind of comment, any new line after the comment has an extra indent. I have noticed this behavior in both C++ and C#.
This is what I get so far:
// Comment with correct indenting
public void TestMethod() { }
It should be:
//Comment with corrent indenting
public void TestMethod() { }
How do I stop the former from happening?
尝试使用Ctrl + K + D缩进整个文件....我认为这应该可以解决问题。
To remove the indentation automatically made by visual studio, select all code by pressing Ctrl+a
, then Press Shift+Tab
twice to remove the indentation that was automatically made by Visual Studio.
And if you want to disable that auto-formatting feature permanently: Goto Tool>Options>Text Editor>C#>Advanced (and then uncheck the options that are not required).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.