From bcc8e1812cefefa064ae2b16b39a9a58a9606694 Mon Sep 17 00:00:00 2001 From: Dmytro Maluka Date: Sun, 14 Jul 2024 15:00:38 +0200 Subject: [PATCH] TryBindKey: ensure returning false if the binding wasn't successful Return false if there is already a binding for the given key, different from the requested binding, and we haven't replaced it with the requested binding due to overwrite set to false. --- internal/action/bindings.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/action/bindings.go b/internal/action/bindings.go index 50b419d1..36cf3ea4 100644 --- a/internal/action/bindings.go +++ b/internal/action/bindings.go @@ -298,7 +298,7 @@ func TryBindKey(k, v string, overwrite bool) (bool, error) { if overwrite { parsed[ev] = v } else { - return true, nil + return parsed[ev] == v, nil } } else { parsed[k] = v