aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexCPP.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2010-08-27 20:31:23 +1000
committernyamatongwe <unknown>2010-08-27 20:31:23 +1000
commit4813fa99a57e119c80cb3d8cdd3f191b16e9c90b (patch)
treeb6de0b41c1114529918dea09e9be6920b734dc0b /lexers/LexCPP.cxx
parent1819741fdce85c763ef277acdd0562c36c5ed94e (diff)
downloadscintilla-mirror-4813fa99a57e119c80cb3d8cdd3f191b16e9c90b.tar.gz
Fixed bugs caused by ignoring single character \n line ends on #include lines
causing preprocessor memory to be out of sync.
Diffstat (limited to 'lexers/LexCPP.cxx')
-rw-r--r--lexers/LexCPP.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
index 588f42e6e..2028c66a9 100644
--- a/lexers/LexCPP.cxx
+++ b/lexers/LexCPP.cxx
@@ -504,6 +504,8 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
}
}
+ const bool atLineEndBeforeSwitch = sc.atLineEnd;
+
// Determine if the current state should terminate.
switch (sc.state & maskActivity) {
case SCE_C_OPERATOR:
@@ -661,6 +663,12 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
}
}
+ if (sc.atLineEnd && !atLineEndBeforeSwitch) {
+ // State exit processing consumed characters up to end of line.
+ lineCurrent++;
+ vlls.Add(lineCurrent, preproc);
+ }
+
// Determine if a new state should be entered.
if ((sc.state & maskActivity) == SCE_C_DEFAULT) {
if (sc.Match('@', '\"')) {