diff options
author | nyamatongwe <unknown> | 2010-08-27 20:31:23 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2010-08-27 20:31:23 +1000 |
commit | 4813fa99a57e119c80cb3d8cdd3f191b16e9c90b (patch) | |
tree | b6de0b41c1114529918dea09e9be6920b734dc0b | |
parent | 1819741fdce85c763ef277acdd0562c36c5ed94e (diff) | |
download | scintilla-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.
-rw-r--r-- | lexers/LexCPP.cxx | 8 |
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('@', '\"')) { |