From db3e9a414a269d35e7a8fda3dba16d8a3ebbc703 Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Tue, 1 Jul 2014 18:53:24 -0400 Subject: [PATCH] ecere/gui/EditBox (Syntax Highlighting): Fixes for .1 and # ifdef --- ecere/src/gui/controls/EditBox.ec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ecere/src/gui/controls/EditBox.ec b/ecere/src/gui/controls/EditBox.ec index fb5d68e..e4aab98 100644 --- a/ecere/src/gui/controls/EditBox.ec +++ b/ecere/src/gui/controls/EditBox.ec @@ -708,7 +708,9 @@ static const char * keyWords1[] = static const char * keyWords2[] = { - "defined", "warning", null + "defined", "warning", + "include", "pragma", "elif", "ifdef", "ifndef", "endif", "undef", "line", + null }; static const char ** keyWords[] = { keyWords1, keyWords2 }; @@ -1787,7 +1789,7 @@ private: } else if(x < box.right && !inQuotes && !inString && !inMultiLineComment && !inSingleLineComment && (isdigit(word[0]) || (word[0] == '.' && isdigit(word[1])))) { - char * dot = word[wordLen] == '.' ? word + wordLen : null; + char * dot = word[wordLen] == '.' ? word + wordLen : (word[0] == '.' && (word == line.buffer || word[-1] == '-' || isspace(word[-1])) ? word : null); bool isReal = dot != null; char * s = null; if(dot) @@ -1869,7 +1871,7 @@ private: if(firstWord) { inPrep = true; - newTextColor = colorScheme.preprocessorColor; + newTextColor = wordLen == 1 ? colorScheme.keywordColors[1] : colorScheme.preprocessorColor; } } if(x < box.right && !inQuotes && !inString && !inMultiLineComment && !inSingleLineComment) -- 1.8.3.1