From a81ad6381bc73747f3dbcbf183acaa8e74bea69e Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 24 Nov 2024 18:41:12 +0100 Subject: [PATCH] SynEdit: Pas-Highlighter. Treat some utf8 as identifiers, to avoid splitting combining marks. Related to Issue #41228 --- components/synedit/synhighlighterpas.pp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/components/synedit/synhighlighterpas.pp b/components/synedit/synhighlighterpas.pp index 5e18d7148f..3b5996108c 100644 --- a/components/synedit/synhighlighterpas.pp +++ b/components/synedit/synhighlighterpas.pp @@ -921,7 +921,7 @@ begin for I := #0 to #255 do begin case I of - '_', '0'..'9', 'a'..'z', 'A'..'Z': Identifiers[I] := True; + '_', '0'..'9', 'a'..'z', 'A'..'Z', #128..#255: Identifiers[I] := True; else Identifiers[I] := False; end; J := UpCase(I); @@ -4304,8 +4304,20 @@ end; procedure TSynPasSyn.SpaceProc; begin inc(Run); + if IsCombiningCodePoint(fLine+Run) then begin + IdentProc; + exit; + end; + fTokenID := tkSpace; + + if not IsSpaceChar[FLine[Run]] then + exit; + + inc(Run); while IsSpaceChar[FLine[Run]] do inc(Run); + if IsCombiningCodePoint(fLine+Run) then + dec(Run); end; procedure TSynPasSyn.StringProc;