summaryrefslogtreecommitdiff
path: root/helix-term/src/config.rs
diff options
context:
space:
mode:
authorgibbz002023-06-03 09:29:08 +0000
committerBlaž Hrastnik2023-06-07 01:11:13 +0000
commit9926c2d292712f38615cc2cb0ca75c1e8ef3bed9 (patch)
tree3391ea1985ccc0d70c2054f98a44d52450485d43 /helix-term/src/config.rs
parentb8563685ec44fd6958514f478d879ba785e916ad (diff)
Remove Keymap(KeyTrie) and simply use KeyTrie.
Diffstat (limited to 'helix-term/src/config.rs')
-rw-r--r--helix-term/src/config.rs15
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,
- })),
+ }),
},
);