mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-17 06:20:28 +00:00
Always use custom syntax files over default
The custom syntax files were first in the array but micro should stop loading files into the filetype if it already found a match. Fixes #750
This commit is contained in:
parent
5dcc486214
commit
5c462f5600
1 changed files with 2 additions and 2 deletions
|
|
@ -208,7 +208,7 @@ func (b *Buffer) UpdateRules() {
|
|||
}
|
||||
|
||||
ft := b.Settings["filetype"].(string)
|
||||
if ft == "Unknown" || ft == "" {
|
||||
if (ft == "Unknown" || ft == "") && !rehighlight {
|
||||
if highlight.MatchFiletype(ftdetect, b.Path, b.lines[0].data) {
|
||||
header := new(highlight.Header)
|
||||
header.FileType = file.FileType
|
||||
|
|
@ -221,7 +221,7 @@ func (b *Buffer) UpdateRules() {
|
|||
rehighlight = true
|
||||
}
|
||||
} else {
|
||||
if file.FileType == ft {
|
||||
if file.FileType == ft && !rehighlight {
|
||||
header := new(highlight.Header)
|
||||
header.FileType = file.FileType
|
||||
header.FtDetect = ftdetect
|
||||
|
|
|
|||
Loading…
Reference in a new issue