From e95830ea8681727d86665d06dd1689019a01a335 Mon Sep 17 00:00:00 2001 From: huki Date: Mon, 24 Sep 2018 09:24:10 +1000 Subject: Backport: Bug [#2045]. LexCPP: Fix 'elif' token length Backport of changeset 7094:fa4b41e8a452. --- doc/ScintillaHistory.html | 9 +++++++-- lexers/LexCPP.cxx | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 0a50bfd6a..d01a3a8b1 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -527,6 +527,7 @@ Luke Rasmussen maboroshin + Gokul Krishnan

@@ -555,13 +556,17 @@ Feature #1185.

  • - Shell folder folds "if", "do", and "case". - Feature #1144. + C++ lexer fixes evaluation of "#elif". + Bug #2045.
  • Markdown lexer fixes highlighting of non-ASCII characters in links.
  • + Shell folder folds "if", "do", and "case". + Feature #1144. +
  • +
  • Fix margin cursor on Cocoa to point more accurately.
  • diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index a3942b5e3..3dac142ab 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -1279,7 +1279,7 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i // Ensure only one chosen out of #if .. #elif .. #elif .. #else .. #endif if (!preproc.CurrentIfTaken()) { // Similar to #if - std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 2, true); + std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 4, true); const bool ifGood = EvaluateExpression(restOfLine, preprocessorDefinitions); if (ifGood) { preproc.InvertCurrentLevel(); -- cgit v1.2.3