From 6aab682728c6b00057c16d4672240d8a01cae510 Mon Sep 17 00:00:00 2001 From: michael tesch Date: Sat, 14 Mar 2015 23:24:41 +0100 Subject: [PATCH] fixed case with multiple other file vars before and after mode: --- 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 ded1102c..58f75b63 100644 --- a/lib/linguist/strategy/modeline.rb +++ b/lib/linguist/strategy/modeline.rb @@ -1,7 +1,7 @@ module Linguist module Strategy class Modeline - EmacsModeline = /-\*-\s*((?!mode)[\w-]+\s*:\s*([\w+-]+)\s*;?\s*)?(mode\s*:)?\s*([\w+-]+)\s*;?\s*((?!mode)[\w-]+\s*:\s*([\w+-]+)\s*;?\s*)?-\*-/i + EmacsModeline = /-\*-\s*((?!mode)[\w-]+\s*:\s*([\w+-]+)\s*;?\s*)*(mode\s*:)?\s*([\w+-]+)\s*(;\s*(?!mode)[\w-]+\s*:\s*([\w+-]+)\s*)*;?\s*-\*-/i VimModeline = /\/\*\s*vim:\s*set\s*(?:ft|filetype)=(\w+):\s*\*\//i # Public: Detects language based on Vim and Emacs modelines