mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-24 01:37:15 +09:00
action/command: Prevent overwriting settings set locally or by plugin
- on `reload` - on `filetype` change
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user