Throw error if there is no detect regex
Closes
package highlight
import (
+ "errors"
"fmt"
"regexp"
@@ -122,6 +123,10 @@ func ParseFtDetect(file *File) (r [2]*regexp.Regexp, err error) {
}
}
+ if loaded == 0 {
+ return r, errors.New("No detect regexes found")
+ }
+
return r, err
}
