]> git.lizzy.rs Git - micro.git/commitdiff
Fix possible crash in findkey
authorZachary Yedidia <zyedidia@gmail.com>
Sat, 28 Apr 2018 21:16:22 +0000 (17:16 -0400)
committerZachary Yedidia <zyedidia@gmail.com>
Sat, 28 Apr 2018 21:16:22 +0000 (17:16 -0400)
Fixes #1103

cmd/micro/bindings.go

index 721226dd1c5d7f4d9cc1b3ef4795cf30600f4b44..d8a0ede0d067ced7f11b0950e11aefffc6e93a37 100644 (file)
@@ -338,6 +338,10 @@ modSearch:
                }
        }
 
+       if len(k) == 0 {
+               return Key{buttons: -1}, false
+       }
+
        // Control is handled specially, since some character codes in bindingKeys
        // are different when Control is depressed. We should check for Control keys
        // first.