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:

[EMAIL PROTECTED] 'for relesae builds' fold }
   If  IsRelease then begin
[EMAIL PROTECTED]
       a:= foo(b);
       writeln(a);
[EMAIL PROTECTED] 'for relesae builds' fold }
   end;
[EMAIL PROTECTED]

This should work. The "begin" should still match the "end"

FoldedView has *some* (but completely untested) preparation for this.

The big task is, that this kind of fold info can not be stared in a 
single combined list of the current type (FoldMinLevel / FoldEndLevel )

- The Highlighter needs to keep/calculate the info independent of the 
current FoldLevel

- Current folds, have some info at *every* line in SynEditTextBuffer. 
User folds are likely to be less in count. So I would suggest *not* to 
add info to every line.
SynEditTextBuffer could have a TAVLTree storing info about each known 
userfold.
- SynEdit.ScanFrom => would need to update the additional fold info

- TFoldedView would have to obey the additional FoldInfo


If you have a different idea, how the problem could be solved, please 
feel free to explain, and we can discuss it.

Best Regards
Martin

_______________________________________________
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to