key_canonicalization now only matches chars

This commit is contained in:
Jan Hrastnik 2021-06-03 12:39:44 +02:00 committed by Blaž Hrastnik
parent 68abc67ec6
commit daad8ebe12

View File

@ -692,8 +692,12 @@ fn cursor_position(&self, area: Rect, editor: &Editor) -> Option<Position> {
}
fn canonicalize_key(key: &mut KeyEvent) -> KeyEvent {
if let KeyEvent { code: KeyCode::Char(_), modifiers: KeyModifiers::SHIFT } = key {
key.modifiers = KeyModifiers::NONE;
if let KeyEvent {
code: KeyCode::Char(_),
modifiers: _,
} = key
{
key.modifiers.remove(KeyModifiers::SHIFT)
}
*key
}
}