🎨 Only pop from scopeStarts if top of stack matches ending scope

This commit is contained in:
Nathan Sobo
2015-09-08 10:33:22 -06:00
parent 6edd3fde76
commit c1d4f3f1a0

View File

@@ -33,13 +33,10 @@ class TokenIterator
if tag < 0
if tag % 2 is 0
scopeName = atom.grammars.scopeForId(tag + 1)
if @scopeStarts.length is 0
@scopeEnds.push(scopeName)
if @scopeStarts[@scopeStarts.length - 1] is scopeName
@scopeStarts.pop()
else
startsTop = this.scopeStarts.pop()
if startsTop isnt scopeName
@scopeStarts.push(startsTop)
@scopeEnds.push(scopeName)
@scopeEnds.push()
@scopes.pop()
else
scope = atom.grammars.scopeForId(tag)