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 <dmitrymaluka@gmail.com>
This commit is contained in:
Jöran Karl
2026-03-16 07:11:59 +01:00
parent 42d0ddf73d
commit bcd6c81f50

View File

@@ -256,6 +256,9 @@ func ReadSettings() error {
func ParsedSettings() map[string]any { func ParsedSettings() map[string]any {
s := make(map[string]any) s := make(map[string]any)
for k, v := range parsedSettings { for k, v := range parsedSettings {
if strings.HasPrefix(reflect.TypeOf(v).String(), "map") {
continue
}
s[k] = v s[k] = v
} }
return s return s