mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 06:37:14 +09:00
Improve file detection with signature check capabilities
This allows more complex detection upon regex rules for a certain amount of lines.
This commit is contained in:
@@ -137,7 +137,7 @@ func generateFile(filetype, syntax, header string, rules []interface{}) string {
|
||||
output += fmt.Sprintf("detect: \n filename: \"%s\"\n", strings.Replace(strings.Replace(syntax, "\\", "\\\\", -1), "\"", "\\\"", -1))
|
||||
|
||||
if header != "" {
|
||||
output += fmt.Sprintf(" header: \"%s\"\n", strings.Replace(strings.Replace(header, "\\", "\\\\", -1), "\"", "\\\"", -1))
|
||||
output += fmt.Sprintf(" signature: \"%s\"\n", strings.Replace(strings.Replace(header, "\\", "\\\\", -1), "\"", "\\\"", -1))
|
||||
}
|
||||
|
||||
output += "\nrules:\n"
|
||||
|
||||
Reference in New Issue
Block a user