diff options
Diffstat (limited to 'helix-term/src/config.rs')
-rw-r--r-- | helix-term/src/config.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/helix-term/src/config.rs b/helix-term/src/config.rs index 9776ef7a..f37b03ec 100644 --- a/helix-term/src/config.rs +++ b/helix-term/src/config.rs @@ -1,5 +1,5 @@ use crate::keymap; -use crate::keymap::{merge_keys, Keymap}; +use crate::keymap::{merge_keys, KeyTrie}; use helix_loader::merge_toml_values; use helix_view::document::Mode; use serde::Deserialize; @@ -12,7 +12,7 @@ use toml::de::Error as TomlError; #[derive(Debug, Clone, PartialEq)] pub struct Config { pub theme: Option<String>, - pub keys: HashMap<Mode, Keymap>, + pub keys: HashMap<Mode, KeyTrie>, pub editor: helix_view::editor::Config, } @@ -20,7 +20,7 @@ pub struct Config { #[serde(deny_unknown_fields)] pub struct ConfigRaw { pub theme: Option<String>, - pub keys: Option<HashMap<Mode, Keymap>>, + pub keys: Option<HashMap<Mode, KeyTrie>>, pub editor: Option<toml::Value>, } @@ -138,7 +138,6 @@ mod tests { #[test] fn parsing_keymaps_config_file() { use crate::keymap; - use crate::keymap::Keymap; use helix_core::hashmap; use helix_view::document::Mode; @@ -155,13 +154,13 @@ mod tests { merge_keys( &mut keys, hashmap! { - Mode::Insert => Keymap::new(keymap!({ "Insert mode" + Mode::Insert => keymap!({ "Insert mode" "y" => move_line_down, "S-C-a" => delete_selection, - })), - Mode::Normal => Keymap::new(keymap!({ "Normal mode" + }), + Mode::Normal => keymap!({ "Normal mode" "A-F12" => move_next_word_end, - })), + }), }, ); |