Skip to content

Commit

Permalink
Fix wrong scope of var (#293)
Browse files Browse the repository at this point in the history
* Fix wrong scope of var
* Fix some keys couldn't bind
  • Loading branch information
vuon9 committed Nov 23, 2021
1 parent 60de823 commit ad95052
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cointop/keybindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit ad95052

Please sign in to comment.