mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Match firstLineRegex against entire file
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user