diff options
author | nyamatongwe <unknown> | 2000-04-28 12:55:31 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2000-04-28 12:55:31 +0000 |
commit | 1258038f9f1988a01c092579e27c992574b5c3b4 (patch) | |
tree | ba0128e8f7199d3af278ecead35f1708bb9baf41 /src | |
parent | 8cbe56a810a49546daf54b9d9b77e862e173d80e (diff) | |
download | scintilla-mirror-1258038f9f1988a01c092579e27c992574b5c3b4.tar.gz |
Fixed unterminated string when using \n line terminators.
Diffstat (limited to 'src')
-rw-r--r-- | src/LexCPP.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx index ea62091df..4f042bd61 100644 --- a/src/LexCPP.cxx +++ b/src/LexCPP.cxx @@ -179,10 +179,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo state = SCE_C_DEFAULT; } } else if (state == SCE_C_STRING) { - if ((ch == '\r' || ch == '\n') && (chPrev != '\\')) { - styler.ColourTo(i-1, SCE_C_STRINGEOL); - state = SCE_C_STRINGEOL; - } else if (ch == '\\') { + if (ch == '\\') { if (chNext == '\"' || chNext == '\'' || chNext == '\\') { i++; ch = chNext; @@ -194,7 +191,10 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo i++; ch = chNext; chNext = styler.SafeGetCharAt(i + 1); - } + } else if (chNext == '\r' || chNext == '\n') { + styler.ColourTo(i-1, SCE_C_STRINGEOL); + state = SCE_C_STRINGEOL; + } } else if (state == SCE_C_CHARACTER) { if ((ch == '\r' || ch == '\n') && (chPrev != '\\')) { styler.ColourTo(i-1, SCE_C_STRINGEOL); |