diff options
author | nyamatongwe <unknown> | 2010-04-29 00:19:15 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2010-04-29 00:19:15 +0000 |
commit | bfeeca4c9deb804f0d50e9a4bec6c138efca6d51 (patch) | |
tree | 444de695c68c04e60153e9a7fc23397068afb82b | |
parent | 5075f7e200be157a77e4fd446ae47badd24bb6e2 (diff) | |
download | scintilla-mirror-bfeeca4c9deb804f0d50e9a4bec6c138efca6d51.tar.gz |
Fix for bug #1683672 CSS lexer - Open comment causes highlighting error
-rw-r--r-- | src/LexCSS.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/LexCSS.cxx b/src/LexCSS.cxx index 3b139cdcd..25f974e63 100644 --- a/src/LexCSS.cxx +++ b/src/LexCSS.cxx @@ -62,6 +62,7 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo int lastState = -1; // before operator int lastStateC = -1; // before comment + int lastStateS = -1; // before single-quoted/double-quoted string int op = ' '; // last operator int opPrev = ' '; // last operator @@ -105,7 +106,7 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo i--; if ((sc.currentPos - i) % 2 == 1) continue; - sc.ForwardSetState(SCE_CSS_VALUE); + sc.ForwardSetState(lastStateS); } if (sc.state == SCE_CSS_OPERATOR) { @@ -280,7 +281,9 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo lastStateC = sc.state; sc.SetState(SCE_CSS_COMMENT); sc.Forward(); - } else if (sc.state == SCE_CSS_VALUE && (sc.ch == '\"' || sc.ch == '\'')) { + } else if ((sc.state == SCE_CSS_VALUE || sc.state == SCE_CSS_ATTRIBUTE) + && (sc.ch == '\"' || sc.ch == '\'')) { + lastStateS = sc.state; sc.SetState((sc.ch == '\"' ? SCE_CSS_DOUBLESTRING : SCE_CSS_SINGLESTRING)); } else if (IsCssOperator(sc.ch) && (sc.state != SCE_CSS_ATTRIBUTE || sc.ch == ']') |