Added modeline strategy

This commit is contained in:
Manuel Carmona
2017-05-10 13:09:51 +02:00
parent 45314b4903
commit 3d867abac3
4 changed files with 193 additions and 1 deletions

View File

@ -36,6 +36,10 @@ func GetLanguageExtensions(language string) []string {
// GetLanguage return the Language for a given filename and file content.
func GetLanguage(filename string, content []byte) string {
if lang, safe := GetLanguageByModeline(content); safe {
return lang
}
if lang, safe := GetLanguageByFilename(filename); safe {
return lang
}