diff options
author | Ivan Tham | 2021-07-02 01:46:28 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-07-04 09:01:59 +0000 |
commit | 5977b07e197cc6ef9051dd34a28b9fe28e01e966 (patch) | |
tree | e14f86efd2d8c44d87f7de25f69ef735b0aaaf92 /helix-term/src/keymap.rs | |
parent | 64f83dfcbd3e093a31b2ef6bd787161ea8904583 (diff) |
Reduce calculation and improve pattern in infobox
- switch to use static OnceCell to calculate Info once
- pass Vec<(&[KeyEvent], &str)> rather than Vec<(Vec<KeyEvent>, &str)>
- expr -> tt to allow using | as separator, make it more like match
Diffstat (limited to 'helix-term/src/keymap.rs')
-rw-r--r-- | helix-term/src/keymap.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs index ef4a2138..3cd540ea 100644 --- a/helix-term/src/keymap.rs +++ b/helix-term/src/keymap.rs @@ -1,11 +1,7 @@ pub use crate::commands::Command; use crate::config::Config; use helix_core::hashmap; -use helix_view::{ - document::Mode, - input::KeyEvent, - keyboard::{KeyCode, KeyModifiers}, -}; +use helix_view::{document::Mode, input::KeyEvent}; use serde::Deserialize; use std::{ collections::HashMap, @@ -352,6 +348,7 @@ pub fn merge_keys(mut config: Config) -> Config { #[test] fn merge_partial_keys() { + use helix_view::keyboard::{KeyCode, KeyModifiers}; let config = Config { keys: Keymaps(hashmap! { Mode::Normal => hashmap! { |