From 3c41d81f5d12185b0cdf53dcf77b5a17e8083bae Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 28 Apr 2024 13:35:35 +0200 Subject: [PATCH] SynEdit: fix endless XML HL, do not return empty tokens. --- components/synedit/synhighlighterxml.pas | 48 +++++++++++++----------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/components/synedit/synhighlighterxml.pas b/components/synedit/synhighlighterxml.pas index 50111f257e..26d704108e 100644 --- a/components/synedit/synhighlighterxml.pas +++ b/components/synedit/synhighlighterxml.pas @@ -792,29 +792,33 @@ end; procedure TSynXMLSyn.Next; begin fTokenPos := Run; - case fRange of - rsText: - begin - TextProc(); + while fTokenPos = Run do begin + case fRange of + rsText: + begin + TextProc(); + end; + rsComment: + begin + CommentProc(); + end; + rsProcessingInstruction: + begin + ProcessingInstructionProc(); + end; + rsDocType, rsDocTypeSquareBraces: //ek 2001-11-11 + begin + DocTypeProc(); + end; + rsCDATA: + begin + CDATAProc(); + end; + else + fProcTable[fLine[Run]](); end; - rsComment: - begin - CommentProc(); - end; - rsProcessingInstruction: - begin - ProcessingInstructionProc(); - end; - rsDocType, rsDocTypeSquareBraces: //ek 2001-11-11 - begin - DocTypeProc(); - end; - rsCDATA: - begin - CDATAProc(); - end; - else - fProcTable[fLine[Run]](); + if fTokenId = tkNull then // EOL + break; end; end;