mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-11-10 06:16:00 +03:00
parent
9d4c301563
commit
28919898e9
@ -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,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user