mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 14:55:38 -04:00
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:
parent
10511c9baf
commit
0542765d95
@ -634,16 +634,10 @@ func (h *BufPane) ResetCmd(args []string) {
|
||||
}
|
||||
|
||||
option := args[0]
|
||||
defaults := config.DefaultAllSettings()
|
||||
|
||||
defaultGlobals := config.DefaultGlobalSettings()
|
||||
defaultLocals := config.DefaultCommonSettings()
|
||||
|
||||
if _, ok := defaultGlobals[option]; ok {
|
||||
SetGlobalOptionNative(option, defaultGlobals[option])
|
||||
return
|
||||
}
|
||||
if _, ok := defaultLocals[option]; ok {
|
||||
h.Buf.SetOptionNative(option, defaultLocals[option])
|
||||
if _, ok := defaults[option]; ok {
|
||||
SetGlobalOptionNative(option, defaults[option])
|
||||
return
|
||||
}
|
||||
InfoBar.Error(config.ErrInvalidOption)
|
||||
|
Loading…
Reference in New Issue
Block a user