mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 14:55:38 -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()
|
||||
for k := range defaultSettings {
|
||||
if _, ok := parsedSettings[k]; ok {
|
||||
SetGlobalOptionNative(k, parsedSettings[k])
|
||||
err = SetGlobalOptionNative(k, parsedSettings[k])
|
||||
} 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...
|
||||
for _, s := range config.LocalSettings {
|
||||
if s == option {
|
||||
MainTab().CurPane().Buf.SetOptionNative(option, nativeValue)
|
||||
return nil
|
||||
return MainTab().CurPane().Buf.SetOptionNative(option, nativeValue)
|
||||
}
|
||||
}
|
||||
|
||||
@ -585,7 +587,9 @@ func SetGlobalOptionNative(option string, nativeValue interface{}) error {
|
||||
}
|
||||
|
||||
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"))
|
||||
|
Loading…
Reference in New Issue
Block a user