mirror of
https://github.com/atom/atom.git
synced 2026-02-14 08:35:11 -05:00
Only use the first line when determine the syntax via file contents
This commit is contained in:
@@ -43,7 +43,9 @@ class Syntax
|
||||
catch e
|
||||
null
|
||||
|
||||
_.find @grammars, (grammar) -> grammar.firstLineRegex?.test(fileContents)
|
||||
if fileContents
|
||||
firstLine = fileContents.match(/^.*$/m)
|
||||
_.find @grammars, (grammar) -> grammar.firstLineRegex?.test(firstLine)
|
||||
|
||||
grammarForScopeName: (scopeName) ->
|
||||
@grammarsByScopeName[scopeName]
|
||||
|
||||
Reference in New Issue
Block a user