From 8aa3e82cd8d2010bedcce63a22add56ae22d515d Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Mon, 16 Jun 2014 18:13:50 +0000 Subject: [PATCH] Try to fix SynEdit's double minus comment bug. http://www.heidisql.com/forum.php?t=15621 --- components/synedit/Source/SynHighlighterSQL.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/synedit/Source/SynHighlighterSQL.pas b/components/synedit/Source/SynHighlighterSQL.pas index 71f02953..eec4544a 100644 --- a/components/synedit/Source/SynHighlighterSQL.pas +++ b/components/synedit/Source/SynHighlighterSQL.pas @@ -1198,7 +1198,7 @@ begin Result := 0; while IsIdentChar(Str^) do begin - FoundDoubleMinus := (Str^ = '-') and ((Str + 1)^ = '-'); + FoundDoubleMinus := (Str^ = '-') and ((Str + 1)^ = '-') and ((Str + 2)^ = ' '); if FoundDoubleMinus then Break; {$IFOPT Q-} Result := 2 * Result + GetOrd; @@ -1409,7 +1409,7 @@ begin else while IsIdentChar(fLine[Run]) do begin - FoundDoubleMinus := (fLine[Run] = '-') and (fLine[Run + 1] = '-'); + FoundDoubleMinus := (fLine[Run] = '-') and (fLine[Run + 1] = '-') and (fLine[Run + 2] = ' '); if FoundDoubleMinus then Break; inc(Run); end; @@ -1657,7 +1657,7 @@ begin fTokenID := tkVariable; i := Run; repeat - FoundDoubleMinus := (fLine[i] = '-') and (fLine[i + 1] = '-'); + FoundDoubleMinus := (fLine[i] = '-') and (fLine[i + 1] = '-') and (fLine[i + 2] = ' '); if FoundDoubleMinus then Break; Inc(i); until not IsIdentChar(fLine[i]);