feat: add ability to map lone <esc> (#475)

Since d2414f7580 <esc> resets key buffer
but this feature prevents binding lone <esc>
This commit is contained in:
Alexey Yerin 2020-10-02 21:30:31 +03:00 committed by GitHub
parent 50dd374f77
commit cf79726d21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
ui.go
View File

@ -941,7 +941,7 @@ func (ui *ui) readNormalEvent(ev tcell.Event) expr {
}
} else {
val := gKeyVal[tev.Key()]
if val == "<esc>" {
if val == "<esc>" && string(ui.keyAcc) != "" {
ui.keyAcc = nil
ui.keyCount = nil
ui.menuBuf = nil