From a4e77fd174d8b7c5cbb7dd6b91848f8a115daae4 Mon Sep 17 00:00:00 2001 From: "Santiago M. Mola" Date: Wed, 7 Sep 2016 16:14:47 +0200 Subject: [PATCH] fix .sls disambiguation (Scheme/SaltStack). --- content.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/content.go b/content.go index 9fd932a..f92e640 100644 --- a/content.go +++ b/content.go @@ -402,13 +402,10 @@ var matchers = map[string]languageMatcher{ return OtherLanguage, false }, ".sls": func(i []byte) (string, bool) { - if substring.BytesRegexp("## |@no-lib-strip@").Match(i) { - return "World of Warcraft Addon Data", true - } else if substring.BytesRegexp("(contentsline|defcounter|beamer|boolfalse)").Match(i) { - return "TeX", true + if schemeMatcher.Match(i) { + return "Scheme", true } - - return OtherLanguage, false + return "SaltStack", false }, ".sql": func(i []byte) (string, bool) { if pgSQLMatcher.Match(i) { @@ -484,4 +481,5 @@ var ( substring.BytesRegexp(`(?i)\$\$PLSQL_|XMLTYPE|sysdate|systimestamp|\.nextval|connect by|AUTHID (DEFINER|CURRENT_USER)`), substring.BytesRegexp(`(?i)constructor\W+function`), ) + schemeMatcher = substring.BytesRegexp(`(?m)\A(^\s*;;.*$)*\s*\(`) )