mirror of
https://github.com/zellij-org/zellij.git
synced 2025-01-07 01:51:37 +03:00
Poking
This commit is contained in:
parent
2b2b7325e7
commit
b4fca93eb7
@ -54,18 +54,17 @@ impl Keybinds {
|
|||||||
/// Merges two Keybinds structs into one Keybinds struct
|
/// Merges two Keybinds structs into one Keybinds struct
|
||||||
/// `other` overrides the ModeKeybinds of `self`.
|
/// `other` overrides the ModeKeybinds of `self`.
|
||||||
fn merge_keybinds(&self, other: Keybinds) -> Keybinds {
|
fn merge_keybinds(&self, other: Keybinds) -> Keybinds {
|
||||||
let mut keybinds = Keybinds::default();
|
let mut keybinds = Keybinds::new();
|
||||||
|
|
||||||
for mode in InputMode::iter() {
|
for mode in self.0.keys().chain(other.0.keys()) {
|
||||||
let mut mode_keybinds: ModeKeybinds = if let Some(keybind) = self.0.get(&mode) {
|
let mut mode_keybinds = ModeKeybinds::new();
|
||||||
keybind.clone()
|
if let Some(keybind) = self.0.get(&mode) {
|
||||||
} else {
|
mode_keybinds.0.extend(keybind.0.clone());
|
||||||
ModeKeybinds::default()
|
|
||||||
};
|
};
|
||||||
if let Some(keybind) = other.0.get(&mode) {
|
if let Some(keybind) = other.0.get(&mode) {
|
||||||
mode_keybinds.0.extend(keybind.0.clone());
|
mode_keybinds.0.extend(keybind.0.clone());
|
||||||
}
|
}
|
||||||
keybinds.0.insert(mode, mode_keybinds);
|
keybinds.0.insert(mode.clone(), mode_keybinds);
|
||||||
}
|
}
|
||||||
keybinds
|
keybinds
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user