aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexCPP.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-05-31 09:27:48 +1000
committerNeil <nyamatongwe@gmail.com>2014-05-31 09:27:48 +1000
commit9bc61b338dfe63d2e6fcc66bc0933a0de6bcd31b (patch)
tree64c541e9dcb42c9999759ab7dd40d67c72749b9a /lexers/LexCPP.cxx
parent8326c658b392ba13e92918dd89deebd60bcd195f (diff)
parent8b447b76bbc110e055a0637657f5f00c65cc98dd (diff)
downloadscintilla-mirror-9bc61b338dfe63d2e6fcc66bc0933a0de6bcd31b.tar.gz
Merge 343-Win32-Fix which fixes hangs and crashes at shutdown on Windows.
Diffstat (limited to 'lexers/LexCPP.cxx')
-rw-r--r--lexers/LexCPP.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
index 7fe680991..b8b48aa52 100644
--- a/lexers/LexCPP.cxx
+++ b/lexers/LexCPP.cxx
@@ -8,10 +8,10 @@
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
+#include <ctype.h>
#include <string>
#include <vector>
@@ -821,10 +821,18 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
((lenS == 1) && ((s[0] == 'L') || (s[0] == 'u') || (s[0] == 'U'))) ||
((lenS == 2) && literalString && (s[0] == 'u') && (s[1] == '8'));
if (valid) {
- if (literalString)
- sc.ChangeState((raw ? SCE_C_STRINGRAW : SCE_C_STRING)|activitySet);
- else
+ if (literalString) {
+ if (raw) {
+ // Set the style of the string prefix to SCE_C_STRINGRAW but then change to
+ // SCE_C_DEFAULT as that allows the raw string start code to run.
+ sc.ChangeState(SCE_C_STRINGRAW|activitySet);
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ } else {
+ sc.ChangeState(SCE_C_STRING|activitySet);
+ }
+ } else {
sc.ChangeState(SCE_C_CHARACTER|activitySet);
+ }
} else {
sc.SetState(SCE_C_DEFAULT | activitySet);
}