Fix a bug where scopes were being duplicated for every single token

This improves scroll performance by generating many fewer span elements
to render lines.
This commit is contained in:
Nathan Sobo
2014-07-20 15:09:14 -07:00
parent 37d0a7f7e5
commit 79ee887c9a

View File

@@ -212,7 +212,7 @@ LinesComponent = React.createClass
# Find a common prefix
for scope, i in desiredScopes
break unless scopeStack[i]?.scope is desiredScopes[i]
break unless scopeStack[i] is desiredScopes[i]
# Pop scopes until we're at the common prefx
until scopeStack.length is i