[Lazarus] user defined code folding regions using $REGION comments

Marc Weustink marc at dommelstein.net
Sun Nov 30 18:02:02 CET 2008


Martin Friebe wrote:
> Gerard N/A wrote:
>> I have a rough implementation that seems to work Ok (I'm cautious
>> because the synedit highlighter is a scary piece of code).
>> If there is interest, I can post a patch to the bug tracker or here.
>>
>>   
> 
> Hi Gerard,
> 
> I saw the patch you uploaded to the bug system.
> 
>  As indicated the user-token must not interfere with real compiler 
> directives. This should still be easy to solve. Instead of looking for a 
> directive named $REGION, you would look for a comment with special content.
> 
> The 2nd issue requires more work.
> 
> consider this:
> 
> {@REGION 'for relesae builds' fold }
>    If  IsRelease then begin
> {@ENDREGION}
>        a:= foo(b);
>        writeln(a);
> {@REGION 'for relesae builds' fold }
>    end;
> {@ENDREGION}

For IDE "directives" we use {%somedirective}

Better use them in this case too.

Marc




More information about the Lazarus mailing list