Skip to content

Commit

Permalink
fix: KeyEvent::char needs to ignore modifiers
Browse files Browse the repository at this point in the history
Fixes #595
  • Loading branch information
archseer committed Aug 26, 2021
1 parent 9d4c301 commit 2891989
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helix-view/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ pub struct KeyEvent {
}

impl KeyEvent {
/// If a character was pressed (without modifiers), return it.
/// If a character was pressed, return it.
pub fn char(&self) -> Option<char> {
match self.code {
KeyCode::Char(ch) if self.modifiers.is_empty() => Some(ch),
KeyCode::Char(ch) => Some(ch),
_ => None,
}
}
Expand Down

0 comments on commit 2891989

Please sign in to comment.