refactor: use a more modern writing style to simplify code (#3834)

Signed-off-by: deepdring <deepdrink@icloud.com>
This commit is contained in:
deepdring
2025-08-26 08:00:51 +08:00
committed by GitHub
parent 094b02da4c
commit b8057f28c6
24 changed files with 98 additions and 100 deletions

View File

@@ -569,7 +569,7 @@ func (h *BufPane) NewTabCmd(args []string) {
}
}
func doSetGlobalOptionNative(option string, nativeValue interface{}) error {
func doSetGlobalOptionNative(option string, nativeValue any) error {
if reflect.DeepEqual(config.GlobalSettings[option], nativeValue) {
return nil
}
@@ -628,7 +628,7 @@ func doSetGlobalOptionNative(option string, nativeValue interface{}) error {
return nil
}
func SetGlobalOptionNative(option string, nativeValue interface{}) error {
func SetGlobalOptionNative(option string, nativeValue any) error {
if err := config.OptionIsValid(option, nativeValue); err != nil {
return err
}
@@ -737,7 +737,7 @@ func (h *BufPane) ShowCmd(args []string) {
return
}
var option interface{}
var option any
if opt, ok := h.Buf.Settings[args[0]]; ok {
option = opt
} else if opt, ok := config.GlobalSettings[args[0]]; ok {