开发者

Visual Studio C# 2008: Code Folding Problem when Typing

I have the following problem with code folding: if I have a class with folded methods, and I insert code in between these methods, the lower code unfolds automatically. E.g.:

class A
{
   void Method1() [ folded ]

   void Method2() [ folded ]

   void Method3() [ folded ]
}

If I insert code between Methods 1 and 2, the following happens in the midst of typing:

class A
{
   void Method1() [ still folded: good ]

   void Method4( [I typed until here and pause]

   void Method2()
   {
      [ unfolded by VS... do not want this! ]
   }

   void Method3()
   {
      [ more auto unfolding... ugh开发者_运维技巧! ]
   }
}

Is there an option to disable the "smart" auto-unfolding done by Visual Studio? I just want to insert Method 4 and keep Methods 2 and 3 folded. As a result of the auto-unfolding, I have to manually fold Methods 2 and 3 again.

I suspect when I typed the open bracket, VS tries to look for a close bracket, but I can't find any option to disable bracket-matching.

Appreciate any help here.


Hint/Trick/Workaround : You could start off by typing the closing bracket first. This is Usually how I avoid unfoldind code when I want to comment blocks (start by the closing tag '* /' at the end of the desired block, and then only insert my opening tag '/ *'

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜