mirror of
https://github.com/zyedidia/micro
synced 2024-11-05 17:41:24 +00:00
UpdateRules: allow includes in default.yaml
This commit is contained in:
parent
5610d01e08
commit
a436dae587
1 changed files with 11 additions and 11 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue