forked from mars/breed
Rename minor modes to submodes in keybinds
This commit is contained in:
parent
3020d14081
commit
c03991f110
|
@ -86,7 +86,7 @@ impl Default for Keybinds {
|
|||
|
||||
#[derive(Clone, Default)]
|
||||
pub struct ModeKeys {
|
||||
pub minor_modes: HashMap<Key, KeyMap>,
|
||||
pub submodes: HashMap<Key, KeyMap>,
|
||||
pub map: KeyMap,
|
||||
}
|
||||
|
||||
|
@ -95,13 +95,13 @@ where
|
|||
T: IntoIterator<Item = &'a (Key, Action)>,
|
||||
{
|
||||
fn from(iter: T) -> Self {
|
||||
let minor_modes = HashMap::new();
|
||||
let submodes = HashMap::new();
|
||||
let mut map = KeyMap::new();
|
||||
for (key, action) in iter {
|
||||
map.insert(*key, Keybind::Action(*action));
|
||||
}
|
||||
|
||||
Self { minor_modes, map }
|
||||
Self { submodes, map }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ impl ModeKeys {
|
|||
match value {
|
||||
Value::Table(table) => {
|
||||
let map = parse_key_map(table)?;
|
||||
keys.minor_modes.insert(key, map);
|
||||
keys.submodes.insert(key, map);
|
||||
}
|
||||
Value::String(keybind) => {
|
||||
let bind = Keybind::try_from(keybind.as_str())?;
|
||||
|
|
Reference in New Issue