From 437ba70b9ee006fd24d894155bfba43499e443f6 Mon Sep 17 00:00:00 2001 From: Brandon Keepers Date: Thu, 29 Jan 2015 13:14:06 -0600 Subject: [PATCH] Find modeline anywhere in the data --- lib/linguist/strategy/modeline.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/strategy/modeline.rb b/lib/linguist/strategy/modeline.rb index 96a73ff8..b23fe08e 100644 --- a/lib/linguist/strategy/modeline.rb +++ b/lib/linguist/strategy/modeline.rb @@ -37,7 +37,7 @@ module Linguist # # Returns a String or nil def self.modeline(data) - data.lines.first(5).any? { |l| l.match(Regex) } + data.match(Regex) lang = $3 end end