Fix non-working TryBindKey and UnbindKey (#1970)

Fixed regression: since merging keybindings branch, TryBindKey and
UnbindKey and accordingly "bind" and "unbind" commands don't work
(fail to unmarshal bindings.json).

This is just a quick fixup to make TryBindKey and UnbindKey work again.
They still work with "buffer" bindings only.
This commit is contained in:
Dmitry Maluka 2021-01-06 01:37:49 +01:00 committed by GitHub
parent c2b58fe861
commit e80f899480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -238,7 +238,7 @@ func findEvent(k string) (Event, error) {
// Returns true if the keybinding already existed and a possible error
func TryBindKey(k, v string, overwrite bool) (bool, error) {
var e error
var parsed map[string]string
var parsed map[string]interface{}
filename := filepath.Join(config.ConfigDir, "bindings.json")
createBindingsIfNotExist(filename)
@ -288,7 +288,7 @@ func TryBindKey(k, v string, overwrite bool) (bool, error) {
// UnbindKey removes the binding for a key from the bindings.json file
func UnbindKey(k string) error {
var e error
var parsed map[string]string
var parsed map[string]interface{}
filename := filepath.Join(config.ConfigDir, "bindings.json")
createBindingsIfNotExist(filename)