Make key macro more portable

pull/924/head
Nehliin 2021-10-17 16:06:21 +02:00 committed by Blaž Hrastnik
parent a4c5f46739
commit da4d9340ba
1 changed files with 2 additions and 2 deletions

View File

@ -12,13 +12,13 @@ use std::{
#[macro_export]
macro_rules! key {
($key:ident) => {
KeyEvent {
::helix_view::input::KeyEvent {
code: ::helix_view::keyboard::KeyCode::$key,
modifiers: ::helix_view::keyboard::KeyModifiers::NONE,
}
};
($($ch:tt)*) => {
KeyEvent {
::helix_view::input::KeyEvent {
code: ::helix_view::keyboard::KeyCode::Char($($ch)*),
modifiers: ::helix_view::keyboard::KeyModifiers::NONE,
}