在VS2010中禁用代码折叠中的双行间距

发布于 2024-10-03 03:13:55 字数 570 浏览 2 评论 0原文

我一直使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

菊凝晚露 2024-10-10 03:13:56

我不确定您的具体问题是否可以通过安装 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.

巴黎夜雨 2024-10-10 03:13:56

只是为了澄清,当您在 Visual Studio 2010 中使用“ctrl + m、ctrl + o”或“ctrl + m、ctrl + m”时,vs 会自动在方法之间添加空白线。

假设您有以下课程:

 public class VsSettings
 {
        void function1()
        {
        }
        void function2()
        {
        }
 }

单击“ctrl + m,ctrl + o”后您会看到以下内容:

 public class VsSettings
    {
        void function1()...

        void function2()...
    }

如果是这样,请尝试重置 Visual Studio 设置(工具 -> 导入和导出设置)并禁用外部插件(如 resharper 等) ..),因为对我来说结果总是如下(启用 resharper、不使用 resharper、设置重置之前、设置重置之后):

  public class VsSettings
        {
            void function1()...    
            void function2()...
        }

希望有所帮助。

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:

 public class VsSettings
 {
        void function1()
        {
        }
        void function2()
        {
        }
 }

And after click 'ctrl + m, ctrl + o' you see following:

 public class VsSettings
    {
        void function1()...

        void function2()...
    }

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):

  public class VsSettings
        {
            void function1()...    
            void function2()...
        }

Hope this help.

§普罗旺斯的薰衣草 2024-10-10 03:13:55

我无法重现它。我正在使用 Visual C# 2010 Express。

namespace Bums
{
    class Bum1
    {
        void Lick1()
        {
            Lick2();
        }
        void Lick2()
        {
            Lick1();
        }
    }
    class Bum2
    {
        void Lick1()
        {
            Lick2();
        }
        void Lick2()
        {
            Lick1();
        }
    }
}

Pinky

(请不要评论我应该如何从基本 IBum 接口派生这两个类)

I can't reproduce it. I'm using Visual C# 2010 Express.

namespace Bums
{
    class Bum1
    {
        void Lick1()
        {
            Lick2();
        }
        void Lick2()
        {
            Lick1();
        }
    }
    class Bum2
    {
        void Lick1()
        {
            Lick2();
        }
        void Lick2()
        {
            Lick1();
        }
    }
}

Pinky

(please no comments about how I should derive both classes from a base IBum interface)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文