Recent

Author Topic: default collapse  (Read 2541 times)

anonymousstranger

  • New Member
  • *
  • Posts: 49
default collapse
« on: August 12, 2018, 11:34:38 pm »
is there a way to make multiline comments, procedures, classes, etc. collapsed by default? I lose a lot of time coding collapsing these blocks so that I can focus in on specific tasks for the day.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: default collapse
« Reply #1 on: August 12, 2018, 11:51:01 pm »
Not as such, but there are a few things that may help.

There are shortcuts to fold everything at a certain "nest-level"
Tools > Options > Editor > KeyMappings: Text Folding commands >  Fold to Level n
Alt-Shift-1..9

Depending on what you have configured as fold-able, top level "class" may be nested on level 2 (nested in type).
But if "unit" is fold-able to it is level 3, and if "implementation" is too, then level 4.
Similar you can count for top level "procedure".

That is not 100% what you need, but it may help a bit.

-----------
More important is the ability to hide comments (and inactive ifdef):
Select all text in the editor (or the text to which you want to apply folds).
Right click the gutter part with the fold symbols, the context menu offers "hide all comments in selection"

------------
You can define your own regions

{%region /fold%}
{%endregion%}

--------------
You can save your folds in your session, so if you close the IDE with some of the above folded, next time you open the project, the folds still exists (only if the source was not changed outside the IDE)
« Last Edit: August 12, 2018, 11:53:23 pm by Martin_fr »

anonymousstranger

  • New Member
  • *
  • Posts: 49
Re: default collapse
« Reply #2 on: August 13, 2018, 12:11:38 am »
Thanks that is at least better than doing each one individually. I have noticed that some folds save while others do not even when there have been no changes outside the IDE. What could cause that?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: default collapse
« Reply #3 on: August 13, 2018, 12:20:45 am »
If you select some lines, you can fold those selected lines (even though they have no begin/end or other pascal fold).
Those "selection folds" do not save.

If it is any other, can you give an example of a fold that does not save?


anonymousstranger

  • New Member
  • *
  • Posts: 49
Re: default collapse
« Reply #4 on: August 13, 2018, 12:33:40 am »
well I tested it out after doing what you suggested and it worked fine. It only seems have happened when I was folding blocks individually (by pressing the "-", not by selection). It was mainly function and procedure blocks, multiline comments, and sometimes class blocks. Half of the folds would save (closer to the beginning of the script usually) but then the other half would not (usually close to the end of the script).

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: default collapse
« Reply #5 on: August 13, 2018, 01:23:12 am »
if it was procedure, class, begin.... then it should have saved.

So if not, it is a bug. If you find an example to reproduce, let me know.

If that happens, please also make a copy of the lps or lpi file (whichever has your session).

---
Btw, if you change the code outside the IDE, then folding may not be re-applied (because the locations may have moved).

 

TinyPortal © 2005-2018