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.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/helix-term/src/config.rs b/helix-term/src/config.rs
index dd051984..a7afead5 100644
--- a/helix-term/src/config.rs
+++ b/helix-term/src/config.rs
@@ -1,7 +1,6 @@
use crate::keymap;
-use crate::keymap::{merge_keys, KeyTrie};
+use crate::keymap::{merge_keys, Domain, KeyTrie};
use helix_loader::merge_toml_values;
-use helix_view::{document::Mode, theme};
use serde::Deserialize;
use std::collections::HashMap;
use std::fmt::Display;
@@ -11,16 +10,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<Domain, KeyTrie>,
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<Domain, KeyTrie>>,
pub editor: Option<toml::Value>,
}
@@ -109,7 +108,6 @@ impl Config {
)?,
}
}
-
// these are just two io errors return the one for the global config
(Err(err), Err(_)) => return Err(err),
};
@@ -155,11 +153,11 @@ mod tests {
merge_keys(
&mut keys,
hashmap! {
- Mode::Insert => keymap!({ "Insert mode"
+ Domain::Mode(Mode::Insert) => keymap!({ "Insert mode"
"y" => move_line_down,
"S-C-a" => delete_selection,
}),
- Mode::Normal => keymap!({ "Normal mode"
+ Domain::Mode(Mode::Normal) => keymap!({ "Normal mode"
"A-F12" => move_next_word_end,
}),
},