mirror of
https://github.com/atom/atom.git
synced 2026-02-03 11:14:59 -05:00
Initial attempt
This commit is contained in:
@@ -841,7 +841,7 @@ class DisplayBuffer extends Model
|
||||
if screenLine.isSoftWrapped() and column >= maxScreenColumn
|
||||
if wrapAtSoftNewlines
|
||||
row++
|
||||
column = 0
|
||||
column = @screenLines[row].tokens[0].value.length # TODO: call screenLine.clipScreenColumn
|
||||
else
|
||||
column = screenLine.clipScreenColumn(maxScreenColumn - 1)
|
||||
else if wrapBeyondNewlines and column > maxScreenColumn and row < @getLastRow()
|
||||
|
||||
@@ -144,6 +144,14 @@ class Token
|
||||
isHardTab: isHardTab
|
||||
)
|
||||
|
||||
buildPhantomToken: (length) ->
|
||||
new Token(
|
||||
value: _.multiplyString(" ", length),
|
||||
scopes: @scopes,
|
||||
bufferDelta: 0,
|
||||
isAtomic: true
|
||||
)
|
||||
|
||||
isOnlyWhitespace: ->
|
||||
not WhitespaceRegex.test(@value)
|
||||
|
||||
|
||||
@@ -97,19 +97,23 @@ class TokenizedLine
|
||||
leftTextLength += nextToken.value.length
|
||||
leftTokens.push nextToken
|
||||
|
||||
tab = leftTokens[0].buildPhantomToken(@indentLevel * 2)
|
||||
|
||||
leftFragment = new TokenizedLine(
|
||||
tokens: leftTokens
|
||||
startBufferColumn: @startBufferColumn
|
||||
ruleStack: @ruleStack
|
||||
invisibles: @invisibles
|
||||
lineEnding: null
|
||||
lineEnding: null,
|
||||
indentLevel: @indentLevel
|
||||
)
|
||||
rightFragment = new TokenizedLine(
|
||||
tokens: rightTokens
|
||||
tokens: [tab].concat(rightTokens)
|
||||
startBufferColumn: @bufferColumnForScreenColumn(column)
|
||||
ruleStack: @ruleStack
|
||||
invisibles: @invisibles
|
||||
lineEnding: @lineEnding
|
||||
lineEnding: @lineEnding,
|
||||
indentLevel: @indentLevel
|
||||
)
|
||||
[leftFragment, rightFragment]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user