mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Assign ::hasInvisibleCharacters on Token shims
This commit is contained in:
@@ -21,7 +21,8 @@ class Token
|
||||
hasInvisibleCharacters: false
|
||||
|
||||
constructor: (properties) ->
|
||||
{@value, @scopes, @isAtomic, @bufferDelta, @isHardTab, @hasPairedCharacter, @isSoftWrapIndentation} = properties
|
||||
{@value, @scopes, @isAtomic, @isHardTab, @bufferDelta} = properties
|
||||
{@hasInvisibleCharacters, @hasPairedCharacter, @isSoftWrapIndentation} = properties
|
||||
@firstNonWhitespaceIndex = properties.firstNonWhitespaceIndex ? null
|
||||
@firstTrailingWhitespaceIndex = properties.firstTrailingWhitespaceIndex ? null
|
||||
|
||||
|
||||
@@ -155,6 +155,7 @@ class TokenizedLine
|
||||
when HardTab
|
||||
tokenProperties.isAtomic = true
|
||||
tokenProperties.bufferDelta = 1
|
||||
tokenProperties.hasInvisibleCharacters = true if @invisibles?.tab
|
||||
when PairedCharacter
|
||||
tokenProperties.isAtomic = true
|
||||
tokenProperties.hasPairedCharacter = true
|
||||
@@ -165,10 +166,12 @@ class TokenizedLine
|
||||
if offset < @firstNonWhitespaceIndex
|
||||
tokenProperties.firstNonWhitespaceIndex =
|
||||
Math.min(tokenProperties.value.length, @firstNonWhitespaceIndex - offset)
|
||||
tokenProperties.hasInvisibleCharacters = true if @invisibles?.space
|
||||
|
||||
if @lineEnding? and (offset + tokenProperties.value.length > @firstTrailingWhitespaceIndex)
|
||||
tokenProperties.firstTrailingWhitespaceIndex =
|
||||
Math.max(0, @firstTrailingWhitespaceIndex - offset)
|
||||
tokenProperties.hasInvisibleCharacters = true if @invisibles?.space
|
||||
|
||||
offset += tokenProperties.value.length
|
||||
|
||||
|
||||
Reference in New Issue
Block a user