From bcd6c81f50e674d185064fed9287c18569a7e256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6ran=20Karl?= <3951388+JoeKar@users.noreply.github.com> Date: Mon, 16 Mar 2026 07:11:59 +0100 Subject: [PATCH] settings: Don't return maps with `ParsedSettings()` Map-typed values in the parsedSettings map do not represent settings for individual options, they represent maps of settings for multiple options for the given glob or ft: pattern, and their keys are not option names, they are glob and ft: patterns. So do not expose them to the callers of ParsedSettings(), to prevent the callers from mistakenly treating those patterns as option names, with unpredicted consequences. Co-authored-by: Dmytro Maluka --- internal/config/settings.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/config/settings.go b/internal/config/settings.go index b7097087..11576955 100644 --- a/internal/config/settings.go +++ b/internal/config/settings.go @@ -256,6 +256,9 @@ func ReadSettings() error { func ParsedSettings() map[string]any { s := make(map[string]any) for k, v := range parsedSettings { + if strings.HasPrefix(reflect.TypeOf(v).String(), "map") { + continue + } s[k] = v } return s