Fix remaining test failures in core

This commit is contained in:
Antonio Scandurra
2017-05-05 09:04:34 +02:00
parent bc34344d90
commit c541d3941c
3 changed files with 58 additions and 58 deletions

View File

@@ -1017,18 +1017,18 @@ class TextEditor extends Model
tokens = []
lineTextIndex = 0
currentTokenScopes = []
{lineText, tagCodes} = @screenLineForScreenRow(screenRow)
for tagCode in tagCodes
if @displayLayer.isOpenTagCode(tagCode)
currentTokenScopes.push(@displayLayer.tagForCode(tagCode))
else if @displayLayer.isCloseTagCode(tagCode)
{lineText, tags} = @screenLineForScreenRow(screenRow)
for tag in tags
if @displayLayer.isOpenTag(tag)
currentTokenScopes.push(@displayLayer.classNameForTag(tag))
else if @displayLayer.isCloseTag(tag)
currentTokenScopes.pop()
else
tokens.push({
text: lineText.substr(lineTextIndex, tagCode)
text: lineText.substr(lineTextIndex, tag)
scopes: currentTokenScopes.slice()
})
lineTextIndex += tagCode
lineTextIndex += tag
tokens
screenLineForScreenRow: (screenRow) ->