From 395d848980d1a9812f868a0c0a250f2f5c138b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6ran=20Karl?= <3951388+JoeKar@users.noreply.github.com> Date: Tue, 23 Jul 2024 21:06:21 +0200 Subject: [PATCH] buffer/settings: Prevent setting of unchanged option --- internal/buffer/settings.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/buffer/settings.go b/internal/buffer/settings.go index 38385c57..0843b461 100644 --- a/internal/buffer/settings.go +++ b/internal/buffer/settings.go @@ -2,12 +2,17 @@ package buffer import ( "crypto/md5" + "reflect" "github.com/zyedidia/micro/v2/internal/config" "github.com/zyedidia/micro/v2/internal/screen" ) func (b *Buffer) SetOptionNative(option string, nativeValue interface{}) error { + if reflect.DeepEqual(b.Settings[option], nativeValue) { + return nil + } + b.Settings[option] = nativeValue if option == "fastdirty" {