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

@@ -86,6 +86,8 @@ type SharedBuffer struct {
// Settings customized by the user
Settings map[string]interface{}
// LocalSettings customized by the user for this buffer only
LocalSettings map[string]bool
Suggestions []string
Completions []string
@@ -326,6 +328,7 @@ func NewBuffer(r io.Reader, size int64, path string, startcursor Loc, btype BufT
// assigning the filetype.
settings := config.DefaultCommonSettings()
b.Settings = config.DefaultCommonSettings()
b.LocalSettings = make(map[string]bool)
for k, v := range config.GlobalSettings {
if _, ok := config.DefaultGlobalOnlySettings[k]; !ok {
// make sure setting is not global-only