mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 23:05:40 -04:00
action/command: On reload
check and inform about errors
This commit is contained in:
parent
9afcb80c95
commit
7f6e5bc860
@ -362,9 +362,12 @@ func reloadRuntime(reloadPlugins bool) {
|
|||||||
defaultSettings := config.DefaultAllSettings()
|
defaultSettings := config.DefaultAllSettings()
|
||||||
for k := range defaultSettings {
|
for k := range defaultSettings {
|
||||||
if _, ok := parsedSettings[k]; ok {
|
if _, ok := parsedSettings[k]; ok {
|
||||||
SetGlobalOptionNative(k, parsedSettings[k])
|
err = SetGlobalOptionNative(k, parsedSettings[k])
|
||||||
} else {
|
} else {
|
||||||
SetGlobalOptionNative(k, defaultSettings[k])
|
err = SetGlobalOptionNative(k, defaultSettings[k])
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
screen.TermMessage(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -526,8 +529,7 @@ func SetGlobalOptionNative(option string, nativeValue interface{}) error {
|
|||||||
// check for local option first...
|
// check for local option first...
|
||||||
for _, s := range config.LocalSettings {
|
for _, s := range config.LocalSettings {
|
||||||
if s == option {
|
if s == option {
|
||||||
MainTab().CurPane().Buf.SetOptionNative(option, nativeValue)
|
return MainTab().CurPane().Buf.SetOptionNative(option, nativeValue)
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -585,7 +587,9 @@ func SetGlobalOptionNative(option string, nativeValue interface{}) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, b := range buffer.OpenBuffers {
|
for _, b := range buffer.OpenBuffers {
|
||||||
b.SetOptionNative(option, nativeValue)
|
if err := b.SetOptionNative(option, nativeValue); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return config.WriteSettings(filepath.Join(config.ConfigDir, "settings.json"))
|
return config.WriteSettings(filepath.Join(config.ConfigDir, "settings.json"))
|
||||||
|
Loading…
Reference in New Issue
Block a user