From 4c190ec9d9da49adedf2e14cd813725d979b42e8 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Tue, 29 Jun 2021 15:13:30 +0800 Subject: [PATCH] Suggestions for infobox changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: BenoƮt Cortier --- helix-term/src/commands.rs | 8 ++++---- helix-term/src/keymap.rs | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 106c58d1..ddeded2d 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3406,18 +3406,18 @@ macro_rules! mode_info { // TODO: how to use one expr for both pat and expr? // TODO: how to use replaced function name as str at compile time? // TODO: extend to support multiple keys, but first solve the other two - {$name:literal, $cx:expr, $($key:expr => $func:expr; $funcs:literal),+,} => { + {$name:literal, $cx:expr, $($key:expr => $func:expr; $desc:literal),+,} => { mode_info! { $name, $cx, - $($key; $key => $func; $funcs,)+ + $($key; $key => $func; $desc,)+ } }; - {$name:literal, $cx:expr, $($key:expr; $keyp:pat => $func:expr; $funcs:literal),+,} => { + {$name:literal, $cx:expr, $($key:expr; $keyp:pat => $func:expr; $desc:literal),+,} => { $cx.editor.autoinfo = Some(Info::key( $name, vec![ $( - (vec![$key], $funcs), + (vec![$key], $desc), )+ ], )); diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs index 53143c71..ef4a2138 100644 --- a/helix-term/src/keymap.rs +++ b/helix-term/src/keymap.rs @@ -105,14 +105,14 @@ use std::{ macro_rules! key { ($key:ident) => { KeyEvent { - code: helix_view::keyboard::KeyCode::$key, - modifiers: helix_view::keyboard::KeyModifiers::NONE, + code: ::helix_view::keyboard::KeyCode::$key, + modifiers: ::helix_view::keyboard::KeyModifiers::NONE, } }; ($($ch:tt)*) => { KeyEvent { - code: helix_view::keyboard::KeyCode::Char($($ch)*), - modifiers: helix_view::keyboard::KeyModifiers::NONE, + code: ::helix_view::keyboard::KeyCode::Char($($ch)*), + modifiers: ::helix_view::keyboard::KeyModifiers::NONE, } }; } @@ -120,8 +120,8 @@ macro_rules! key { macro_rules! ctrl { ($($ch:tt)*) => { KeyEvent { - code: helix_view::keyboard::KeyCode::Char($($ch)*), - modifiers: helix_view::keyboard::KeyModifiers::CONTROL, + code: ::helix_view::keyboard::KeyCode::Char($($ch)*), + modifiers: ::helix_view::keyboard::KeyModifiers::CONTROL, } }; } @@ -129,8 +129,8 @@ macro_rules! ctrl { macro_rules! alt { ($($ch:tt)*) => { KeyEvent { - code: helix_view::keyboard::KeyCode::Char($($ch)*), - modifiers: helix_view::keyboard::KeyModifiers::ALT, + code: ::helix_view::keyboard::KeyCode::Char($($ch)*), + modifiers: ::helix_view::keyboard::KeyModifiers::ALT, } }; }