From 4a9058c3bd9b46c69cf1cd60599b89b83e28c60a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6ran=20Karl?= <3951388+JoeKar@users.noreply.github.com> Date: Fri, 14 Feb 2025 20:57:11 +0100 Subject: [PATCH] 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. --- internal/buffer/settings.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/buffer/settings.go b/internal/buffer/settings.go index 2e9005b2..661ba3fd 100644 --- a/internal/buffer/settings.go +++ b/internal/buffer/settings.go @@ -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" {