long time, sorry ....
Still reviewing, but the patches are now certainly better than the existing code, so I will commit it (patch 15 is committed to svn), even if it needs more work (review pending).
---------------------------
FNestList2 isn't needed. And used incorectly.
In AddVerticalLine
FNestList2.Line := ANode.LineIndex;
l := ToPos(FNestList2.NodeEndLine[0]);
returns the endline of the most outer node (usually the unit...end / so end of file)
You were looking for
l := ToPos(FNestList2.NodeEndLine[FNestList2.Count-1]);
Though that depends what node you want, if more than one opens on that line.
Or better (ANodeIdx is the index of the ANode, from the nestlist):
l := ToPos(FNestList.NodeEndLine[ANodeIdx]);
I did make those changes, before I commited
------------------------
You may want to check in DoTextChanged (line 731)
if sfaOutline in FoldAction then begin
FNestList.Line := LineIndex;
l := ToPos(FNestList.NodeEndLine[FNestList.Count]);
that is the most inner node before-or-on the current line, if any. (or crash if none, but I believe the if is only true if there are nodes.
You really should have the index at which the node was found. But then at the time FNestList may have changed....
----------------------
Why is there
SetCacheCount(100);
in create?
----------------------
your detection for shared buffer did no longer work, since the array always has some length (well it would have the length from the previous buffer anyway?)
I fixed that.
----------------------
need to check, that it does nothing, if not enabled (markup.RealEnabled)
also you probably need override RealEnabled, since you got more colors.... (the var should be FColors, not Colors). Not sure what (if any) is stored in MarkupInfo in your case.
Also in RealEnabled check if the Highlighter has support.....
----------------------
I started a test case.
But its only a dummy, to show how it can be done.
Also add only behaviour that is save not to change...
----------------------
more later......