mirror of
https://github.com/zyedidia/micro.git
synced 2024-10-27 20:49:47 +03:00
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:
parent
c2b58fe861
commit
e80f899480
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user