mirror of
https://github.com/zyedidia/micro.git
synced 2024-09-11 12:15:52 +03:00
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.
This commit is contained in:
parent
37b5284005
commit
bcc8e1812c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user