From 1645601aa99664c9fecb98a1a46aacfb660a936b Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 5 Mar 2018 16:20:30 +1100 Subject: Backport: Bug [#1999]. Fix hang lexing a Lua label where the range ends before "::". Backport of changeset 6473:daf991b38f03. --- doc/ScintillaHistory.html | 4 ++++ lexlib/StyleContext.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index c52d96878..92a525eeb 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -592,6 +592,10 @@ Fix move-extends-selection mode for rectangular and line selections.
  • + Fix hang in Lua lexer when lexing a label upto the terminating "::". + Bug #1999. +
  • +
  • Fix HTML lexer handling of Django so that nesting a {{ }} or {% %} Django tag inside of a {# #} Django comment does not break highlighting of rest of file
  • diff --git a/lexlib/StyleContext.h b/lexlib/StyleContext.h index b9f42cf1a..cdb3aa91f 100644 --- a/lexlib/StyleContext.h +++ b/lexlib/StyleContext.h @@ -131,7 +131,12 @@ public: void ForwardBytes(Sci_Position nb) { const Sci_PositionU forwardPos = currentPos + nb; while (forwardPos > currentPos) { + const Sci_PositionU currentPosStart = currentPos; Forward(); + if (currentPos == currentPosStart) { + // Reached end + return; + } } } void ChangeState(int state_) { -- cgit v1.2.3