aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexlib/StyleContext.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-03-05 16:20:30 +1100
committerNeil <nyamatongwe@gmail.com>2018-03-05 16:20:30 +1100
commit1645601aa99664c9fecb98a1a46aacfb660a936b (patch)
treec16c91e76d11c3e1f5633b0a351055dc056c1376 /lexlib/StyleContext.h
parentdcb8510be29dd09b2ffd6e4a0e7e792ac56ce5e5 (diff)
downloadscintilla-mirror-1645601aa99664c9fecb98a1a46aacfb660a936b.tar.gz
Backport: Bug [#1999]. Fix hang lexing a Lua label where the range ends before "::".
Backport of changeset 6473:daf991b38f03.
Diffstat (limited to 'lexlib/StyleContext.h')
-rw-r--r--lexlib/StyleContext.h5
1 files changed, 5 insertions, 0 deletions
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_) {