Many optimizations and new syntax files

This commit is contained in:
Zachary Yedidia
2017-03-26 19:14:03 -04:00
parent 56f3992cdb
commit 084c2be66c
103 changed files with 2079 additions and 342 deletions
+2 -2
View File
@@ -2,11 +2,11 @@ package highlight
func DetectFiletype(defs []*Def, filename string, firstLine []byte) *Def {
for _, d := range defs {
if d.ftdetect[0].Match([]byte(filename)) {
if d.ftdetect[0].MatchString(filename) {
return d
}
if len(d.ftdetect) > 1 {
if d.ftdetect[1].Match(firstLine) {
if d.ftdetect[1].MatchString(string(firstLine)) {
return d
}
}