mirror of
https://github.com/atom/atom.git
synced 2026-02-12 23:55:10 -05:00
Terminate when no more tokens and at end of line
This corrects a regression when pattern matching to the newline was added. If the newline is never matched the loop still needs to terminated so now when the position is before the newline and the last match had no tokens the loop is broken out of.
This commit is contained in:
@@ -53,6 +53,7 @@ class TextMateGrammar
|
||||
|
||||
tokens.push(nextTokens...)
|
||||
position = tokensEndPosition
|
||||
break if position is line.length and nextTokens.length is 0
|
||||
|
||||
else # push filler token for unmatched text at end of line
|
||||
if position < line.length
|
||||
|
||||
Reference in New Issue
Block a user