mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Optimize breakOutAtomicTokens
This commit is contained in:
@@ -23,6 +23,11 @@ class Token
|
||||
[new Token(value: value1, scopes: @scopes), new Token(value: value2, scopes: @scopes)]
|
||||
|
||||
breakOutAtomicTokens: (tabLength, breakOutLeadingWhitespace) ->
|
||||
if breakOutLeadingWhitespace
|
||||
return [this] unless /^[ ]|\t/.test(@value)
|
||||
else
|
||||
return [this] unless /\t/.test(@value)
|
||||
|
||||
outputTokens = []
|
||||
regex = new RegExp("([ ]{#{tabLength}})|(\t)|([^\t]+)", "g")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user