Skip to content

Instantly share code, notes, and snippets.

@jerstlouis
Created October 19, 2013 23:17
Show Gist options
  • Save jerstlouis/7062773 to your computer and use it in GitHub Desktop.
Save jerstlouis/7062773 to your computer and use it in GitHub Desktop.
diff --git a/ecere/src/gui/controls/EditBox.ec b/ecere/src/gui/controls/EditBox.ec
index 46818b3..df7a4ea 100644
--- a/ecere/src/gui/controls/EditBox.ec
+++ b/ecere/src/gui/controls/EditBox.ec
@@ -1516,6 +1516,7 @@ private:
// ****** SYNTAX HIGHLIGHTING ******
bool lastWasStar = false;
bool firstWord = true;
+ bool wasInMultiLine = false;
if(!escaped) inPrep = false;
inSingleLineComment = continuedSingleLineComment;
escaped = false;
@@ -1643,6 +1644,7 @@ private:
bool backInQuotes = inQuotes;
bool backInPrep = inPrep;
bool backInSingleLineComment = inSingleLineComment;
+ bool backWasInMultiLine = wasInMultiLine;
char * word = line.buffer + c - wordLen;
int g,ccc;
@@ -1650,6 +1652,8 @@ private:
escaped = false;
lastWasStar = false;
+ wasInMultiLine = inMultiLineComment;
+
// Determine Syntax Highlighting
newTextColor = defaultTextColor;
if(style.syntax)
@@ -1686,11 +1690,13 @@ private:
}
}
else if(backLastWasStar)
+ {
inMultiLineComment = false;
+ }
}
else if(wordLen == 1 && word[0] == '*')
{
- if(c < 2 || word[-1] != '/')
+ if(backWasInMultiLine)
lastWasStar = true;
}
else if(!inSingleLineComment && !inMultiLineComment && !inQuotes && wordLen == 1 && word[0] == '\"')
@@ -1786,6 +1792,7 @@ private:
inQuotes = backInQuotes;
inPrep = backInPrep;
inSingleLineComment = backInSingleLineComment;
+ wasInMultiLine = backWasInMultiLine;
break;
}
else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment