在VS2010中禁用代码折叠中的双行间距
我一直使用 Visual Studio 2008 中的代码折叠命令 - 例如,
ctrl + m, ctrl + o (collapse all)
ctrl + m, ctrl + m (toggle expand/collapse of code block)
Visual Studio 2010 具有“改进”,折叠代码现在在一个块与下一个块之间有一条空白线。例如,
void function1()[+]{...}
void function2()[+]{...}
而不是VS2008的方式
void function1()[+]{...}
void function2()[+]{...}
任何人都知道如何防止VS2010添加这个白线空间 - 这非常令人恼火!
更新:似乎很多人都无法重现。但由于这个问题迄今为止已经有 6 票赞成,我假设有人可以。
C# 用户报告说他们无法重现。我专门用 C++ 编写代码,这绝对是 C++ 中的一个问题。也许我会向 m$ 发布报告...
I use the code folding commands in Visual Studio 2008 all the time - e.g.
ctrl + m, ctrl + o (collapse all)
ctrl + m, ctrl + m (toggle expand/collapse of code block)
Visual Studio 2010 has the "improvement" that folded code now has a white space line between one block and the next. e.g.
void function1()[+]{...}
void function2()[+]{...}
Instead of the VS2008 way
void function1()[+]{...}
void function2()[+]{...}
Anyone know how to prevent VS2010 from adding this whiteline space - it's extremely irritating!
Update: it seems that lots of folks can't reproduce. but since this question has got 6 up votes to date, I'm assuming that there are those who can.
C# users report that they can't reproduce. I code in c++ exclusively and it's definitely a problem in c++. Maybe I'll post a report to m$...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不确定您的具体问题是否可以通过安装 Productivity Power Tools,但我刚刚在安装的 C++ 项目中测试了折叠显示,它的工作方式与 VS2008 中的工作方式一样。 生产力强大工具添加了许多其他不错的小功能,并修复了 VS2010 中的一些问题,使它们无论如何都值得拥有。
附加说明:我们正在运行 VS2010 Ultimate,尽管我不认为该版本很重要。
I'm not sure if your specific issue is addressed by installing the Productivity Power Tools, but I just tested out the collapsed display in a C++ project in my install and it works as it used to in VS2008. The Productivity Power Tools add a lot of other nice little features and fix some irritations in VS2010 that make them worth having anyways.
Additional note: We're running VS2010 Ultimate, although I wouldn't expect the edition to matter.
只是为了澄清,当您在 Visual Studio 2010 中使用“ctrl + m、ctrl + o”或“ctrl + m、ctrl + m”时,vs 会自动在方法之间添加空白线。
假设您有以下课程:
单击“ctrl + m,ctrl + o”后您会看到以下内容:
如果是这样,请尝试重置 Visual Studio 设置(工具 -> 导入和导出设置)并禁用外部插件(如 resharper 等) ..),因为对我来说结果总是如下(启用 resharper、不使用 resharper、设置重置之前、设置重置之后):
希望有所帮助。
Just to clarify, when you using 'ctrl + m, ctrl + o' or 'ctrl + m, ctrl + m' in visual studio 2010, then vs automatically add white space line between methods.
Suppose you have following class:
And after click 'ctrl + m, ctrl + o' you see following:
If so then try to reset visual studio settings(tools -> import and export settings) and disable external plugins(like resharper, etc..), because for me result always was following(with resharper enabled, without resharper, before settings reset, after settings reset):
Hope this help.
我无法重现它。我正在使用 Visual C# 2010 Express。
(请不要评论我应该如何从基本 IBum 接口派生这两个类)
I can't reproduce it. I'm using Visual C# 2010 Express.
(please no comments about how I should derive both classes from a base IBum interface)