提交 660d3458 编写于 作者: Z Zachary Yedidia

Don't apply cli options to settings.json

上级 ae05ff18
......@@ -480,6 +480,7 @@ func SetGlobalOptionNative(option string, nativeValue interface{}) error {
if !local {
config.GlobalSettings[option] = nativeValue
config.ModifiedSettings[option] = true
if option == "colorscheme" {
// LoadSyntaxFiles()
......
......@@ -28,9 +28,14 @@ var (
// This is the raw parsed json
parsedSettings map[string]interface{}
// ModifiedSettings is a map of settings which should be written to disk
// because they have been modified by the user in this session
ModifiedSettings map[string]bool
)
func init() {
ModifiedSettings = make(map[string]bool)
parsedSettings = make(map[string]interface{})
}
......@@ -163,7 +168,9 @@ func WriteSettings(filename string) error {
// add any options to parsedSettings that have since been marked as non-default
for k, v := range GlobalSettings {
if def, ok := defaults[k]; !ok || !reflect.DeepEqual(v, def) {
parsedSettings[k] = v
if _, wr := ModifiedSettings[k]; wr {
parsedSettings[k] = v
}
}
}
......@@ -183,7 +190,9 @@ func OverwriteSettings(filename string) error {
defaults := DefaultGlobalSettings()
for k, v := range GlobalSettings {
if def, ok := defaults[k]; !ok || !reflect.DeepEqual(v, def) {
settings[k] = v
if _, wr := ModifiedSettings[k]; wr {
settings[k] = v
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册