From ad95052e028486c01a699276ac5745bfb91d30d7 Mon Sep 17 00:00:00 2001 From: Vuong <3168632+vuon9@users.noreply.github.com> Date: Wed, 24 Nov 2021 03:46:44 +0700 Subject: [PATCH] Fix wrong scope of var (#293) * Fix wrong scope of var * Fix some keys couldn't bind --- cointop/keybindings.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cointop/keybindings.go b/cointop/keybindings.go index 75c5a55..0c4abc5 100644 --- a/cointop/keybindings.go +++ b/cointop/keybindings.go @@ -51,10 +51,9 @@ func (ct *Cointop) ParseKeys(s string) (interface{}, tcell.ModMask) { mod := tcell.ModNone // translate legacy and special names for keys - s = strings.TrimSpace(s) - keyName := keyMap(s) - if len(s) > 1 { - keyName := strings.Replace(s, "+", "-", -1) + keyName := keyMap(strings.TrimSpace(s)) + if len(keyName) > 1 { + keyName = strings.Replace(keyName, "+", "-", -1) split := strings.Split(keyName, "-") if len(split) > 1 { @@ -98,7 +97,7 @@ func (ct *Cointop) ParseKeys(s string) (interface{}, tcell.ModMask) { } if key == nil { - log.Debugf("Could not map key descriptio '%s' to key", s) + log.Debugf("Could not map key '%s' to key", s) } return key, mod }