anyway, my markup slowdown when scroll at about 4000 lines.
I test using GR32.pas ( has 6500 lines).
But it fast enough at earlier lines ( < 1000 ) using the same file
I got it!
Finding parent + grandpa in TLazSynEditNestedFoldsList, will always continue until the
most top the "unit" keyword (root of folds, at first line ) founded !
And it is repeated for each line in my markup class.
(it's not my fault, its default behaviour of NestedFoldLIst).
Anyway, It (find till "unit") is not required by another markup (such as triplet WordGroup markup).
Actually
my markup didn't require it (find till "unit") either. Because the
first fold to be colored is "
procedure".
But naturally TLazSynEditNestedFoldsList will not stop until first (#zero ) grand parent fold reached.
Yes obviously there are not used grand parents : "unit", "interface", "implementation".
That is why my markup was slowing down: repeat searching the "unit" for each visible line.
---
I have a quick solution: stop search the grand parent when the "procedure" keyword is just reached.
This way, will make my markup only work in Pascal Highlighter, or may need some complex configuration for other HL.
But, you have had another solution: to cache the finding parent in NestedFoldList class.
This way will keep markup independent for any HL.
Using cache will speedup finding root, because of reusing the founded grand parent instead of actual repeated finding.
I think the second (yours) solution is far better.
but,well, my internal problem is TLazSynEditNestedFoldsList just too complex for my brain.
No worry, I am creating my own NestedFold getter class. It will be easier for me when create new class with that everything is under control.
Anther reason is I also hate the ReleaseReference + AddReference (aliens) things.
It's far better to use Create + Free. Which are common and predicable behavior.
Overall, have a nice day @Martin_fr. Have a nice trip !
I most probably send you pictures rather than ask to check the source code.
Thanks