SynEdit: Wrapped-view, fix inserting lines

(cherry picked from commit bbee19f531)
This commit is contained in:
Martin 2025-01-24 10:08:48 +01:00
parent b81824c552
commit c01af285f4

View File

@ -876,20 +876,15 @@ var
CurrentPage: TSynEditLineMapPageHolder;
begin
CurrentPage := FindPageForLine(ALineIdx, afmPrev);
if not CurrentPage.HasPage then begin
CurrentPage := FirstPage;
if not CurrentPage.HasPage then begin
CurrentPage := FindPageForLine(ALineIdx, afmCreate);
if not CurrentPage.HasPage then
exit;
end;
end;
// inherited => moves any node with FStartLine >= AStartLine
inherited AdjustForLinesInserted(ALineIdx, ALineCount);
// TODO ::::XXXXX ONLY if inside the page / otherwise call invalidate
CurrentPage.AdjustForLinesInserted(ALineIdx, ALineCount, ABytePos);
// CurrentPage.StartLine is still the old value
if CurrentPage.HasPage then
CurrentPage.AdjustForLinesInserted(ALineIdx, ALineCount, ABytePos)
else
InvalidateLines(ALineIdx, ALineIdx+ALineCount-1);
end;
procedure TSynLineMapAVLTree.AdjustForLinesDeleted(AStartLine, ALineCount,