x2nie,
did you test the patch?
I have had big problem running my app demo that uses synedit+SynEditMarkupFoldColoring.pas, something has been changed somewhere in months.
But I found the bugfix. The problem is in my demo app (that earlier works):
procedure TForm1.FormCreate(Sender: TObject);
var
M : TSynEditMarkupFoldColors;
S : TSynEdit;
begin
s := SynEdit1;
s.Highlighter := nil; // my original markupcoloring unit doesn't require this
M := TSynEditMarkupFoldColors.Create(s);
s.MarkupManager.AddMarkUp(M);
s.Highlighter := SynFreePascalSyn1; // so this reseting doesn't required by my original markupcoloring unit.
end;
Interesting to see in SynEditMarkupFoldColoring, that the error occurred from this line:
NestCount := FNestList.Count;
that forwarding to:
function TLazSynEditNestedFoldsList.Count: Integer;
begin
if (FCount < 0) then begin
InitCount;
end;
if FIncludeOpeningOnLine and (FOpeningOnLineCount < 0) then begin
InitOpeningOnLine;
end;
Result := FCount + OpeningOnLineCount;
end;
and finally this triggering error on:
procedure TLazSynEditNestedFoldsList.InitCount;
begin
if FHighLighter = nil then exit;
FHighLighter.CurrentLines := FLines;
FCount := FHighlighter.
FoldBlockEndLevel(FLine - 1, FFoldGroup, FFoldFlags); <-------------------- Why it is needed on InitCount ????
FEvaluationIndex := FCount;
SetLength(FNestInfo, FCount+1);
end;
which is end up with this line:
function TSynPasSyn.FoldBlockEndLevel(ALineIndex: TLineIdx;
const AFilter: TSynFoldBlockFilter): integer;
var
inf: TSynPasRangeInfo;
r, r2: Pointer;
begin
Assert(CurrentRanges <> nil, 'TSynCustomFoldHighlighter.FoldBlockEndLevel requires CurrentRanges');
However, we can make next progress.
Thanks @Pascal !