Skip to content

Commit 7f6e5bc

Browse files
committed
action/command: On reload check and inform about errors
1 parent 9afcb80 commit 7f6e5bc

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

internal/action/command.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,12 @@ func reloadRuntime(reloadPlugins bool) {
362362
defaultSettings := config.DefaultAllSettings()
363363
for k := range defaultSettings {
364364
if _, ok := parsedSettings[k]; ok {
365-
SetGlobalOptionNative(k, parsedSettings[k])
365+
err = SetGlobalOptionNative(k, parsedSettings[k])
366366
} else {
367-
SetGlobalOptionNative(k, defaultSettings[k])
367+
err = SetGlobalOptionNative(k, defaultSettings[k])
368+
}
369+
if err != nil {
370+
screen.TermMessage(err)
368371
}
369372
}
370373
}
@@ -526,8 +529,7 @@ func SetGlobalOptionNative(option string, nativeValue interface{}) error {
526529
// check for local option first...
527530
for _, s := range config.LocalSettings {
528531
if s == option {
529-
MainTab().CurPane().Buf.SetOptionNative(option, nativeValue)
530-
return nil
532+
return MainTab().CurPane().Buf.SetOptionNative(option, nativeValue)
531533
}
532534
}
533535

@@ -585,7 +587,9 @@ func SetGlobalOptionNative(option string, nativeValue interface{}) error {
585587
}
586588

587589
for _, b := range buffer.OpenBuffers {
588-
b.SetOptionNative(option, nativeValue)
590+
if err := b.SetOptionNative(option, nativeValue); err != nil {
591+
return err
592+
}
589593
}
590594

591595
return config.WriteSettings(filepath.Join(config.ConfigDir, "settings.json"))

0 commit comments

Comments
 (0)