Skip to content

Commit 0542765

Browse files
committed
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().
1 parent 10511c9 commit 0542765

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

internal/action/command.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -634,16 +634,10 @@ func (h *BufPane) ResetCmd(args []string) {
634634
}
635635

636636
option := args[0]
637+
defaults := config.DefaultAllSettings()
637638

638-
defaultGlobals := config.DefaultGlobalSettings()
639-
defaultLocals := config.DefaultCommonSettings()
640-
641-
if _, ok := defaultGlobals[option]; ok {
642-
SetGlobalOptionNative(option, defaultGlobals[option])
643-
return
644-
}
645-
if _, ok := defaultLocals[option]; ok {
646-
h.Buf.SetOptionNative(option, defaultLocals[option])
639+
if _, ok := defaults[option]; ok {
640+
SetGlobalOptionNative(option, defaults[option])
647641
return
648642
}
649643
InfoBar.Error(config.ErrInvalidOption)

0 commit comments

Comments
 (0)