Forum > Editor
default collapse
anonymousstranger:
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:
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)
anonymousstranger:
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:
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:
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).
Navigation
[0] Message Index
[#] Next page