action/command: Prevent overwriting settings set locally or by plugin

- on `reload`
- on `filetype` change
This commit is contained in:
Jöran Karl
2024-07-26 21:06:06 +02:00
parent f661b64e0a
commit 05529596cf
3 changed files with 23 additions and 12 deletions

View File

@@ -410,7 +410,7 @@ func reloadRuntime(reloadPlugins bool) {
for _, b := range buffer.OpenBuffers {
config.InitLocalSettings(b.Settings, b.Path)
for k, v := range b.Settings {
b.SetOptionNative(k, v)
b.DoSetOptionNative(k, v)
}
b.UpdateRules()
}
@@ -610,9 +610,8 @@ func SetGlobalOptionNative(option string, nativeValue interface{}) error {
// ...at last check the buffer locals
for _, b := range buffer.OpenBuffers {
if err := b.SetOptionNative(option, nativeValue); err != nil {
return err
}
b.DoSetOptionNative(option, nativeValue)
delete(b.LocalSettings, option)
}
return config.WriteSettings(filepath.Join(config.ConfigDir, "settings.json"))