From 5607148ff787a9bc5ac3f08bbf935f18d89df442 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 5 Mar 2018 16:20:30 +1100 Subject: Bug [#1999]. Fix hang lexing a Lua label where the range ends before "::". --- doc/ScintillaHistory.html | 4 ++++ lexlib/StyleContext.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 108b6904c..85beb83f3 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -540,6 +540,10 @@ Released 12 February 2018.
  • + Fix hang in Lua lexer when lexing a label upto the terminating "::". + Bug #1999. +
  • +
  • For rectangular selections, pressing Home or End now moves the caret to the Home or End position instead of the limit of the rectangular selection.
  • diff --git a/lexlib/StyleContext.h b/lexlib/StyleContext.h index a76f7f417..1d40825f4 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