Fix position translation bug for wrapped lines with hard tabs

Fixes #1681
This commit is contained in:
Nathan Sobo
2014-03-04 17:55:53 -07:00
parent 33f0ca3042
commit 06bc09951d
2 changed files with 10 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ class TokenizedLine
@tokens = @breakOutAtomicTokens(tokens, tabLength)
@startBufferColumn ?= 0
@text = _.pluck(@tokens, 'value').join('')
@bufferDelta = _.sum(_.pluck(@tokens, 'bufferDelta'))
copy: ->
new TokenizedLine({@tokens, @lineEnding, @ruleStack, @startBufferColumn, @fold})
@@ -55,7 +56,7 @@ class TokenizedLine
@text.length
getMaxBufferColumn: ->
@startBufferColumn + @getMaxScreenColumn()
@startBufferColumn + @bufferDelta
softWrapAt: (column) ->
return [new TokenizedLine([], '', [0, 0], [0, 0]), this] if column == 0
@@ -78,7 +79,7 @@ class TokenizedLine
)
rightFragment = new TokenizedLine(
tokens: rightTokens
startBufferColumn: @startBufferColumn + column
startBufferColumn: @bufferColumnForScreenColumn(column)
ruleStack: @ruleStack
lineEnding: @lineEnding
)