mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
💄
This commit is contained in:
@@ -28,16 +28,22 @@ class Token
|
||||
regex = new RegExp("([ ]{#{tabLength}})|(\t)|([^\t]+)", "g")
|
||||
while match = regex.exec(@value)
|
||||
if match[1] and breakOutLeadingWhitespace
|
||||
outputTokens.push(@buildTabToken(tabLength, false))
|
||||
outputTokens.push(@buildSoftTabToken(tabLength, false))
|
||||
else if match[2]
|
||||
breakOutLeadingWhitespace = false
|
||||
outputTokens.push(@buildTabToken(tabLength, true))
|
||||
outputTokens.push(@buildHardTabToken(tabLength, true))
|
||||
else
|
||||
breakOutLeadingWhitespace = false
|
||||
outputTokens.push(new Token(value: match[0], scopes: @scopes))
|
||||
|
||||
outputTokens
|
||||
|
||||
buildHardTabToken: (tabLength) ->
|
||||
@buildTabToken(tabLength, true)
|
||||
|
||||
buildSoftTabToken: (tabLength) ->
|
||||
@buildTabToken(tabLength, false)
|
||||
|
||||
buildTabToken: (tabLength, isHardTab) ->
|
||||
new Token(
|
||||
value: _.multiplyString(" ", tabLength)
|
||||
|
||||
Reference in New Issue
Block a user