aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexCPP.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2010-08-27 20:31:23 +1000
committernyamatongwe <devnull@localhost>2010-08-27 20:31:23 +1000
commitf83e42b0a9bfd93d8d136e994ab6920439ff8e52 (patch)
tree7bc05aaba47709f060bba0bccd13ff3f64a7032b /lexers/LexCPP.cxx
parent072179485245b6e47502727c8be1f13a6cc2d8ca (diff)
downloadscintilla-mirror-f83e42b0a9bfd93d8d136e994ab6920439ff8e52.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('@', '\"')) {