From 110ccc9b7ad48a57e16c05ab850f948bafd700f6 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 26 Dec 2012 15:22:39 -0800 Subject: [PATCH] Match firstLineRegex against entire file --- src/app/text-mate-bundle.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/text-mate-bundle.coffee b/src/app/text-mate-bundle.coffee index af463c5e2..6ead4ccff 100644 --- a/src/app/text-mate-bundle.coffee +++ b/src/app/text-mate-bundle.coffee @@ -50,11 +50,11 @@ class TextMateBundle @grammarByShebang: (filePath) -> try - firstLine = fs.read(filePath).match(/.*/)[0] + fileContents = fs.read(filePath) catch e null - _.find @grammars, (grammar) -> grammar.firstLineRegex?.test(firstLine) + _.find @grammars, (grammar) -> grammar.firstLineRegex?.test(fileContents) @grammarForScopeName: (scopeName) -> @grammarsByScopeName[scopeName]