From 8a5808c87b93c49e1fca9b730b5e8558d4a55228 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 15 Jan 2019 10:37:34 +1100 Subject: Backport: Treat "#if(" as preprocessor directive "#if" followed by operator "(". Backport of changeset 7233:e08fe2381ca3. --- doc/ScintillaHistory.html | 5 +++++ lexers/LexCPP.cxx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index f801fd477..bf31ff711 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -549,6 +549,11 @@ Released 10 January 2019.
  • + The C++ lexer, with styling.within.preprocessor on, now interprets "(" in preprocessor "#if(" + as an operator instead of part of the directive. This improves folding as well which could become + unbalanced. +
  • +
  • Fix raw strings in nim. Feature #1253.
  • diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index d6637784a..e2d47de6f 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -950,7 +950,7 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i break; case SCE_C_PREPROCESSOR: if (options.stylingWithinPreprocessor) { - if (IsASpace(sc.ch)) { + if (IsASpace(sc.ch) || (sc.ch == '(')) { sc.SetState(SCE_C_DEFAULT|activitySet); } } else if (isStringInPreprocessor && (sc.Match('>') || sc.Match('\"') || sc.atLineEnd)) { -- cgit v1.2.3