aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexCPP.cxx
diff options
context:
space:
mode:
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('@', '\"')) {