action/command: Prevent setting of unchanged option

This commit is contained in:
Jöran Karl
2024-07-23 21:04:21 +02:00
parent 521b63a28c
commit c741e36d2d

View File

@@ -7,6 +7,7 @@ import (
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"reflect"
"regexp" "regexp"
"strconv" "strconv"
"strings" "strings"
@@ -531,6 +532,10 @@ func (h *BufPane) NewTabCmd(args []string) {
} }
func doSetGlobalOptionNative(option string, nativeValue interface{}) error { func doSetGlobalOptionNative(option string, nativeValue interface{}) error {
if reflect.DeepEqual(config.GlobalSettings[option], nativeValue) {
return nil
}
config.GlobalSettings[option] = nativeValue config.GlobalSettings[option] = nativeValue
config.ModifiedSettings[option] = true config.ModifiedSettings[option] = true
delete(config.VolatileSettings, option) delete(config.VolatileSettings, option)