Skip to content

Commit

Permalink
key_canonicalization now only matches chars
Browse files Browse the repository at this point in the history
  • Loading branch information
janhrastnik authored and archseer committed Jun 3, 2021
1 parent 68abc67 commit daad8eb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,12 @@ impl Component for EditorView {
}

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
}
}

0 comments on commit daad8eb

Please sign in to comment.