Find modeline anywhere in the data

This commit is contained in:
Brandon Keepers
2015-01-29 13:14:06 -06:00
parent fadca563bc
commit 437ba70b9e

View File

@@ -37,7 +37,7 @@ module Linguist
# #
# Returns a String or nil # Returns a String or nil
def self.modeline(data) def self.modeline(data)
data.lines.first(5).any? { |l| l.match(Regex) } data.match(Regex)
lang = $3 lang = $3
end end
end end