mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-17 22:37:10 +09:00
UpdateRules: allow includes in default.yaml
This commit is contained in:
@@ -911,6 +911,17 @@ func (b *Buffer) UpdateRules() {
|
||||
b.SyntaxDef = findRuntimeSyntaxDef(syntaxFile, header)
|
||||
}
|
||||
|
||||
if b.SyntaxDef != nil {
|
||||
b.Settings["filetype"] = b.SyntaxDef.FileType
|
||||
} else {
|
||||
// search for the default file in the user's custom syntax files
|
||||
b.SyntaxDef = findRealRuntimeSyntaxDef("default", nil)
|
||||
if b.SyntaxDef == nil {
|
||||
// search for the default file in the runtime files
|
||||
b.SyntaxDef = findRuntimeSyntaxDef("default", nil)
|
||||
}
|
||||
}
|
||||
|
||||
if b.SyntaxDef != nil && highlight.HasIncludes(b.SyntaxDef) {
|
||||
includes := highlight.GetIncludes(b.SyntaxDef)
|
||||
|
||||
@@ -947,17 +958,6 @@ func (b *Buffer) UpdateRules() {
|
||||
highlight.ResolveIncludes(b.SyntaxDef, files)
|
||||
}
|
||||
|
||||
if b.SyntaxDef != nil {
|
||||
b.Settings["filetype"] = b.SyntaxDef.FileType
|
||||
} else {
|
||||
// search for the default file in the user's custom syntax files
|
||||
b.SyntaxDef = findRealRuntimeSyntaxDef("default", nil)
|
||||
if b.SyntaxDef == nil {
|
||||
// search for the default file in the runtime files
|
||||
b.SyntaxDef = findRuntimeSyntaxDef("default", nil)
|
||||
}
|
||||
}
|
||||
|
||||
if b.SyntaxDef != nil {
|
||||
b.Highlighter = highlight.NewHighlighter(b.SyntaxDef)
|
||||
if b.Settings["syntax"].(bool) {
|
||||
|
||||
Reference in New Issue
Block a user