mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-19 07:15:34 -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]
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user