Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/config.rs')
| -rw-r--r-- | helix-term/src/config.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/helix-term/src/config.rs b/helix-term/src/config.rs index dd051984..9776ef7a 100644 --- a/helix-term/src/config.rs +++ b/helix-term/src/config.rs @@ -1,7 +1,7 @@ use crate::keymap; -use crate::keymap::{merge_keys, KeyTrie}; +use crate::keymap::{merge_keys, Keymap}; use helix_loader::merge_toml_values; -use helix_view::{document::Mode, theme}; +use helix_view::document::Mode; use serde::Deserialize; use std::collections::HashMap; use std::fmt::Display; @@ -11,16 +11,16 @@ use toml::de::Error as TomlError; #[derive(Debug, Clone, PartialEq)] pub struct Config { - pub theme: Option<theme::Config>, - pub keys: HashMap<Mode, KeyTrie>, + pub theme: Option<String>, + pub keys: HashMap<Mode, Keymap>, pub editor: helix_view::editor::Config, } #[derive(Debug, Clone, PartialEq, Deserialize)] #[serde(deny_unknown_fields)] pub struct ConfigRaw { - pub theme: Option<theme::Config>, - pub keys: Option<HashMap<Mode, KeyTrie>>, + pub theme: Option<String>, + pub keys: Option<HashMap<Mode, Keymap>>, pub editor: Option<toml::Value>, } @@ -109,7 +109,6 @@ impl Config { )?, } } - // these are just two io errors return the one for the global config (Err(err), Err(_)) => return Err(err), }; @@ -139,6 +138,7 @@ 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 +155,13 @@ mod tests { merge_keys( &mut keys, hashmap! { - Mode::Insert => keymap!({ "Insert mode" + Mode::Insert => Keymap::new(keymap!({ "Insert mode" "y" => move_line_down, "S-C-a" => delete_selection, - }), - Mode::Normal => keymap!({ "Normal mode" + })), + Mode::Normal => Keymap::new(keymap!({ "Normal mode" "A-F12" => move_next_word_end, - }), + })), }, ); |