{%region} with folded by default flag
Original Reporter info from Mantis: ggeldenhuys
-
Reporter name: Graeme Geldenhuys
Original Reporter info from Mantis: ggeldenhuys
- Reporter name: Graeme Geldenhuys
Description:
I think it will be very handy if we can extend that syntax to include a default 'folded by default' option to the {%region} tags. For example: Say I want the editor to default show all code folding as collapsed (no folding by default), but a certain GUI initialization method I always want folded by default - because that code is normally auto generated and the developer 99.9% of the time doesn't need to fiddle in there...
{%REGION 'GUI initialization code' fold }
// GUI initialization code goes here
{%ENDREGION }
The %REGION now has a comment 'GUI Initialization' and trigger 'fold' that says by default this region must be folded when this unit is displayed in the editor.
Visual Studio has such a feature which by default hides the code generated by the visual forms designer. This is exactly what I would like to have in Lazarus where fpGUI based projects don't use external *.lfm files, but rather all GUI layout is done in code by the fpGUI UI Designer.
As for the syntax or keyboard using inside the {%region ....} to tell the editor to fold the code by default is up for discussion. They keyword 'fold' might not be the best choice. :-)
Also, maybe similar syntax could be used like is already done for the TODO items. -c = category, -o = owner etc... maybe for %region the -f = fold by default. Just a thought.
Mantis conversion info:
- Mantis ID: 13514
- OS: Ubuntu Linux
- OS Build: 7.10
- Platform: x86
- Version: 0.9.27 (SVN)
- Fixed in version: 0.9.27 (SVN)
- Fixed in revision: 20526 (#6de1371b)
- Target version: 0.9.28