mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 06:12:35 +09:00
Improve new syntax files and fix a region glitch
This commit is contained in:
@@ -135,10 +135,10 @@ func generateFile(filetype, syntax, header string, rules []interface{}) string {
|
||||
output := ""
|
||||
|
||||
output += fmt.Sprintf("filetype: %s\n\n", filetype)
|
||||
output += fmt.Sprintf("detect: \n filename: \"%s\"\n", strings.Replace(syntax, "\\", "\\\\", -1))
|
||||
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(header, "\\", "\\\\", -1))
|
||||
output += fmt.Sprintf(" header: \"%s\"\n", strings.Replace(strings.Replace(header, "\\", "\\\\", -1), "\"", "\\\"", -1))
|
||||
}
|
||||
|
||||
output += "\nrules:\n"
|
||||
|
||||
Reference in New Issue
Block a user