mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Adding Emacs modes
This commit is contained in:
@@ -23,7 +23,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(/\W(?:filetype|ft)=\s*(\w+)/) }
|
data.lines.first(5).any? { |l| l.match(/\W(?:filetype=|ft=|mode:|-*-)\s*(\w+)/) }
|
||||||
lang = $1
|
lang = $1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user