Trim s before checking length

pull/290/head
Simon Roberts 3 years ago committed by GitHub
parent 6402c67a34
commit b1fd9d065d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -51,11 +51,12 @@ 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.TrimSpace(strings.Replace(s, "+", "-", -1))
split := strings.Split(keyName, "-")
keyName := strings.Replace(s, "+", "-", -1)
split := strings.Split(keyName, "-")
if len(split) > 1 {
m := strings.ToLower(strings.TrimSpace(split[0]))
k := strings.TrimSpace(split[1])

Loading…
Cancel
Save