From a1e8681acf85f3ed93cbc53ee74a290e3e4a5fc8 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 29 Mar 2009 06:34:44 +0000 Subject: =?UTF-8?q?Patch=20from=20Enrico=20Tr=C3=B6ger=20to=20support=20RF?= =?UTF-8?q?C2822=20text=20but=20does=20not=20include=20avoidance=20of=20li?= =?UTF-8?q?nes=20with=20leading=20white=20space.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/LexOthers.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/LexOthers.cxx b/src/LexOthers.cxx index 0db6e8f2c..6f500a06e 100644 --- a/src/LexOthers.cxx +++ b/src/LexOthers.cxx @@ -640,6 +640,9 @@ static void ColourisePoDoc(unsigned int startPos, int length, int, WordList *[], } } +static inline bool isassignchar(unsigned char ch) { + return (ch == '=') || (ch == ':'); +} static void ColourisePropsLine( char *lineBuffer, @@ -658,14 +661,14 @@ static void ColourisePropsLine( styler.ColourTo(endPos, SCE_PROPS_SECTION); } else if (lineBuffer[i] == '@') { styler.ColourTo(startLine + i, SCE_PROPS_DEFVAL); - if (lineBuffer[++i] == '=') + if (isassignchar(lineBuffer[i++])) styler.ColourTo(startLine + i, SCE_PROPS_ASSIGNMENT); styler.ColourTo(endPos, SCE_PROPS_DEFAULT); } else { // Search for the '=' character - while ((i < lengthLine) && (lineBuffer[i] != '=')) + while ((i < lengthLine) && !isassignchar(lineBuffer[i])) i++; - if ((i < lengthLine) && (lineBuffer[i] == '=')) { + if ((i < lengthLine) && isassignchar(lineBuffer[i])) { styler.ColourTo(startLine + i - 1, SCE_PROPS_KEY); styler.ColourTo(startLine + i, SCE_PROPS_ASSIGNMENT); styler.ColourTo(endPos, SCE_PROPS_DEFAULT); -- cgit v1.2.3