Rename minor modes to submodes in keybinds

This commit is contained in:
mars 2023-04-14 14:31:29 -04:00
parent 3020d14081
commit c03991f110
1 changed files with 4 additions and 4 deletions

View File

@ -86,7 +86,7 @@ impl Default for Keybinds {
#[derive(Clone, Default)] #[derive(Clone, Default)]
pub struct ModeKeys { pub struct ModeKeys {
pub minor_modes: HashMap<Key, KeyMap>, pub submodes: HashMap<Key, KeyMap>,
pub map: KeyMap, pub map: KeyMap,
} }
@ -95,13 +95,13 @@ where
T: IntoIterator<Item = &'a (Key, Action)>, T: IntoIterator<Item = &'a (Key, Action)>,
{ {
fn from(iter: T) -> Self { fn from(iter: T) -> Self {
let minor_modes = HashMap::new(); let submodes = HashMap::new();
let mut map = KeyMap::new(); let mut map = KeyMap::new();
for (key, action) in iter { for (key, action) in iter {
map.insert(*key, Keybind::Action(*action)); map.insert(*key, Keybind::Action(*action));
} }
Self { minor_modes, map } Self { submodes, map }
} }
} }
@ -114,7 +114,7 @@ impl ModeKeys {
match value { match value {
Value::Table(table) => { Value::Table(table) => {
let map = parse_key_map(table)?; let map = parse_key_map(table)?;
keys.minor_modes.insert(key, map); keys.submodes.insert(key, map);
} }
Value::String(keybind) => { Value::String(keybind) => {
let bind = Keybind::try_from(keybind.as_str())?; let bind = Keybind::try_from(keybind.as_str())?;