Switch character measurement to TokenIterator

Instead of using TokenizedLine::tokens shim
This commit is contained in:
Nathan Sobo
2015-05-14 01:10:29 +02:00
parent c76b45206b
commit 0ca967d6b0

View File

@@ -354,19 +354,22 @@ class LinesComponent
iterator = null
charIndex = 0
for {value, scopes, hasPairedCharacter} in tokenizedLine.tokens
tokenIterator = TokenIterator.instance.reset(tokenizedLine)
while tokenIterator.next()
scopes = tokenIterator.getScopes()
text = tokenIterator.getText()
charWidths = @presenter.getScopedCharacterWidths(scopes)
valueIndex = 0
while valueIndex < value.length
if hasPairedCharacter
char = value.substr(valueIndex, 2)
textIndex = 0
while textIndex < text.length
if tokenIterator.isPairedCharacter()
char = text
charLength = 2
valueIndex += 2
textIndex += 2
else
char = value[valueIndex]
char = text[textIndex]
charLength = 1
valueIndex++
textIndex++
continue if char is '\0'