Author Topic: How to only have the ability to expand/contract braces in selective display?  (Read 235 times)

rowbearto

  • Senior Community Member
  • Posts: 808
  • Hero Points: 26
I'd like to be able to have a "+/-" in the margin for each brace pair in my C++ code, so I can collapse any braces - whether it is a function, if statement, for loop, etc.

How to configure this with selective display? I'm having a hard time figuring it out.

rowbearto

  • Senior Community Member
  • Posts: 808
  • Hero Points: 26
Figured out what I want - it is the "show-statements".

Now I'd like a way to expand everything that I may have had, but keep the + signs. I think to do this I need to do a "show-all" (expands everything, but also gets rid of + signs), and then do "show-statements" again. Now I'll bind this to a key so I can do this quickly.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2254
  • Hero Points: 283
Try this:  Document > C/C++ Options... > View > Create file outline

   (  ) Symbol level
   (x) Statement level
   (  ) Do not create file outline

Then you will see the [-] for each block.

However, here's the secret.  It's not really necessary.  The "plusminus" command ( Ctrl+Backslash) will expand or collapse statement blocks for you whether you created the outline in advance or not.  So, if you expand and collapse blocks using the keyboard, it just works.  You know where you statements start, so having the [-] sign from the selective display outline really isn't that helpful, unless you want to expand/collapse sections using the mouse.

rowbearto

  • Senior Community Member
  • Posts: 808
  • Hero Points: 26
Thanks for the tip about Ctrl+\ and plusminus, very useful!

I found that "show-statements" did not show the +/- signs when I had a very large source file, and "show-braces" was needed for the next best thing.

Is there some threshold of file size where "show-statements" works?

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2254
  • Hero Points: 283
Tools > Options > Editing > Context Tagging > Maximums > Maximum size of files for statement tagging (KB)

The show-statements should probably override that option.  I'll look into that for the next release.