From be424c365fcdea7ea6df396d1a21bc913638dd76 Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Tue, 6 Nov 2012 10:03:02 -0800 Subject: [PATCH] :lipstick: --- src/app/token.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/token.coffee b/src/app/token.coffee index 211c190d8..749b195aa 100644 --- a/src/app/token.coffee +++ b/src/app/token.coffee @@ -24,12 +24,13 @@ class Token breakOutAtomicTokens: (tabLength, breakOutLeadingWhitespace) -> outputTokens = [] - regex = new RegExp("([ ]{#{tabLength}})|(\t)|([^\t]+)", "g") + while match = regex.exec(@value) - if match[1] and breakOutLeadingWhitespace + [fullMatch, softTab, hardTab] = match + if softTab and breakOutLeadingWhitespace outputTokens.push(@buildSoftTabToken(tabLength, false)) - else if match[2] + else if hardTab breakOutLeadingWhitespace = false outputTokens.push(@buildHardTabToken(tabLength, true)) else