buffer: Move UpdatePathGlobLocals() before updating the filetype

Like in NewBuffer(), we need to update glob-based local settings
before updating the filetype, since the filetype itself may be among those
glob-based local settings.
This commit is contained in:
Jöran Karl 2025-02-14 20:57:11 +01:00
parent 982a4fe065
commit 4a9058c3bd

View File

@ -12,6 +12,7 @@ import (
func (b *Buffer) ReloadSettings(reloadFiletype bool) {
settings := config.ParsedSettings()
config.UpdatePathGlobLocals(settings, b.AbsPath)
_, local := b.LocalSettings["filetype"]
_, volatile := config.VolatileSettings["filetype"]
@ -26,7 +27,6 @@ func (b *Buffer) ReloadSettings(reloadFiletype bool) {
// update syntax rules, which will also update filetype if needed
b.UpdateRules()
config.UpdatePathGlobLocals(settings, b.AbsPath)
config.UpdateFileTypeLocals(settings, b.Settings["filetype"].(string))
for k, v := range config.DefaultCommonSettings() {
if k == "filetype" {