From b1fd9d065d990ff21e601856a79f1f71b44af2a6 Mon Sep 17 00:00:00 2001 From: Simon Roberts Date: Mon, 22 Nov 2021 10:22:20 +1100 Subject: [PATCH] Trim s before checking length --- cointop/keybindings.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cointop/keybindings.go b/cointop/keybindings.go index b4af3e1..75c5a55 100644 --- a/cointop/keybindings.go +++ b/cointop/keybindings.go @@ -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])