mirror of
https://github.com/atom/atom.git
synced 2026-02-09 06:05:11 -05:00
Individual tokens no longer need an isAtomic property
This commit is contained in:
@@ -192,7 +192,7 @@ class Renderer
|
||||
folds.sort (a, b) -> a.compare(b)
|
||||
|
||||
buildFoldPlaceholder: (fold) ->
|
||||
token = {value: '...', type: 'fold-placeholder', fold, isAtomic: true}
|
||||
token = { value: '...', type: 'fold-placeholder', fold }
|
||||
new ScreenLineFragment([token], '...', [0, 3], fold.getRange().toDelta(), isAtomic: true)
|
||||
|
||||
screenLineRangeForBufferRange: (bufferRange) ->
|
||||
|
||||
@@ -34,17 +34,10 @@ class ScreenLineFragment
|
||||
[leftFragment, rightFragment]
|
||||
|
||||
splitTokenAt: (token, splitIndex) ->
|
||||
if token.isAtomic
|
||||
[@buildFillerToken(splitIndex), token]
|
||||
else
|
||||
{ type, value } = token
|
||||
value1 = value.substring(0, splitIndex)
|
||||
value2 = value.substring(splitIndex)
|
||||
[{value: value1, type }, {value: value2, type}]
|
||||
|
||||
buildFillerToken: (length) ->
|
||||
text = (' ' for i in [0...length]).join('')
|
||||
{ value: text, type: 'text' }
|
||||
{ type, value } = token
|
||||
value1 = value.substring(0, splitIndex)
|
||||
value2 = value.substring(splitIndex)
|
||||
[{value: value1, type }, {value: value2, type}]
|
||||
|
||||
concat: (other) ->
|
||||
tokens = @tokens.concat(other.tokens)
|
||||
@@ -53,12 +46,6 @@ class ScreenLineFragment
|
||||
bufferDelta = @bufferDelta.add(other.bufferDelta)
|
||||
new ScreenLineFragment(tokens, text, screenDelta, bufferDelta)
|
||||
|
||||
lengthForClipping: ->
|
||||
if @isAtomic
|
||||
0
|
||||
else
|
||||
@text.length
|
||||
|
||||
isSoftWrapped: ->
|
||||
@screenDelta.row == 1 and @bufferDelta.row == 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user