SynEdit: WordWrap, fix re-wrap. "Validate()" may have validated further nodes, NextBlockForValidation needs to check that before returning a node.

This commit is contained in:
Martin 2025-03-22 18:47:58 +01:00
parent a19d14529d
commit be2125328e

View File

@ -2159,16 +2159,18 @@ begin
FCurrentValidatingNode.ClearData; FCurrentValidatingNode.ClearData;
end; end;
Result := FInvalidEntryList.FFirstEntry <> nil; repeat
if not Result then Result := FInvalidEntryList.FFirstEntry <> nil;
exit; if not Result then
exit;
FCurrentValidatingNode := NextNodeForValidation; // TODO: directly fill FCurrentValidatingNode; FCurrentValidatingNode := NextNodeForValidation; // TODO: directly fill FCurrentValidatingNode;
Result := FCurrentValidatingNode.HasPage; Result := FCurrentValidatingNode.HasPage;
assert(result, 'TSynLineMapAVLTree.NextBlockForValidation: result'); assert(result, 'TSynLineMapAVLTree.NextBlockForValidation: result');
ALowLine := FCurrentValidatingNode.FirstInvalidLine; ALowLine := FCurrentValidatingNode.FirstInvalidLine;
AHighLine := FCurrentValidatingNode.FirstInvalidEndLine; AHighLine := FCurrentValidatingNode.FirstInvalidEndLine;
FCurrentValidatingNodeLastLine := -1; // If there was a next node, inval lines would be on that next node, and not on this FCurrentValidatingNodeLastLine := -1; // If there was a next node, inval lines would be on that next node, and not on this
until ALowLine >= 0;
end; end;
procedure TSynLineMapAVLTree.EndValidate; procedure TSynLineMapAVLTree.EndValidate;