action/command: Simplify ResetCmd

It doesn't need to loop over the DefaultCommonSettings() again,
since they're already included in the default settings and set via
SetGlobalOptionNative().
This commit is contained in:
Jöran Karl 2024-08-08 20:38:19 +02:00
parent 10511c9baf
commit 0542765d95

View File

@ -634,16 +634,10 @@ func (h *BufPane) ResetCmd(args []string) {
} }
option := args[0] option := args[0]
defaults := config.DefaultAllSettings()
defaultGlobals := config.DefaultGlobalSettings() if _, ok := defaults[option]; ok {
defaultLocals := config.DefaultCommonSettings() SetGlobalOptionNative(option, defaults[option])
if _, ok := defaultGlobals[option]; ok {
SetGlobalOptionNative(option, defaultGlobals[option])
return
}
if _, ok := defaultLocals[option]; ok {
h.Buf.SetOptionNative(option, defaultLocals[option])
return return
} }
InfoBar.Error(config.ErrInvalidOption) InfoBar.Error(config.ErrInvalidOption)