From a9b91106cbd04ddf48a0c895e1ab3de34ce9654d Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Mon, 8 Feb 2021 07:35:56 +0900 Subject: [PATCH] Fix GitHub #610: Syntax Higlighment - Why WinMerge search for keywords/directives inside of strings ? --- .../crystaledit/editlib/parsers/autoit.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Externals/crystaledit/editlib/parsers/autoit.cpp b/Externals/crystaledit/editlib/parsers/autoit.cpp index 0a493d5251e..8a35c0e533f 100644 --- a/Externals/crystaledit/editlib/parsers/autoit.cpp +++ b/Externals/crystaledit/editlib/parsers/autoit.cpp @@ -590,6 +590,17 @@ CrystalLineParser::ParseLineAutoIt (unsigned dwCookie, const TCHAR *pszChars, in break; } + // String constant '....' + if (dwCookie & COOKIE_CHAR) + { + if (pszChars[I] == '\'') + { + dwCookie &= ~COOKIE_CHAR; + bRedefineBlock = true; + } + continue; + } + // String constant "...." if (dwCookie & COOKIE_STRING) { @@ -639,6 +650,14 @@ CrystalLineParser::ParseLineAutoIt (unsigned dwCookie, const TCHAR *pszChars, in continue; } + // Normal text + if (pszChars[I] == '\'') + { + DEFINE_BLOCK (I, COLORINDEX_STRING); + dwCookie |= COOKIE_CHAR; + continue; + } + if (bFirstChar) { if (pszChars[I] == '#')