From d78f455b237c539ff0c8d0de3c9c6ec8bd40a212 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Sat, 31 Aug 2013 10:00:16 -0700 Subject: [PATCH] Push filler tokens when no patterns match an empty line This ensures that empty lines always contain tokens even when no patterns match on empty lines. --- src/text-mate-grammar.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text-mate-grammar.coffee b/src/text-mate-grammar.coffee index f19a3053c..aecbffbf8 100644 --- a/src/text-mate-grammar.coffee +++ b/src/text-mate-grammar.coffee @@ -145,7 +145,7 @@ class TextMateGrammar break if position is line.length and nextTokens.length is 0 and ruleStack.length is previousRuleStackLength else # push filler token for unmatched text at end of line - if position < line.length + if position < line.length or line.length == 0 tokens.push(new Token( value: line[position...line.length] scopes: scopes