on master help sign in
fix: KeyEvent::char needs to ignore modifiers
2891989Blaž Hrastnik
helix-view/src/input.rs+2−2
@@ -15,10 +15,10 @@ pub struct KeyEvent {
15}
15}
16
16
17impl KeyEvent {
17impl KeyEvent {
18− /// If a character was pressed (without modifiers), return it.
18+ /// If a character was pressed, return it.
19 pub fn char(&self) -> Option<char> {
19 pub fn char(&self) -> Option<char> {
20 match self.code {
20 match self.code {
21− KeyCode::Char(ch) if self.modifiers.is_empty() => Some(ch),
21+ KeyCode::Char(ch) => Some(ch),
22 _ => None,
22 _ => None,
23 }
23 }
24 }
24 }