Fix decoding of letter trailer CSI key event

This commit is contained in:
Kovid Goyal 2022-10-07 11:35:38 +05:30
parent 9f2b2eac85
commit 430bd23870
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -154,9 +154,14 @@ func KeyEventFromCSI(csi string) *KeyEvent {
third_section = get_sub_sections(sections[2]) third_section = get_sub_sections(sections[2])
} }
var ans = KeyEvent{Type: PRESS} var ans = KeyEvent{Type: PRESS}
keynum := first_section[0] var keynum int
if val, ok := letter_trailer_to_csi_number_map[last_char]; ok { if val, ok := letter_trailer_to_csi_number_map[last_char]; ok {
keynum = val keynum = val
} else {
if len(first_section) == 0 {
return nil
}
keynum = first_section[0]
} }
key_name := func(keynum int) string { key_name := func(keynum int) string {