diff options
Diffstat (limited to 'zellij-utils/src/input/keybinds.rs')
-rw-r--r-- | zellij-utils/src/input/keybinds.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/zellij-utils/src/input/keybinds.rs b/zellij-utils/src/input/keybinds.rs index eaed03fd4..ab13f711f 100644 --- a/zellij-utils/src/input/keybinds.rs +++ b/zellij-utils/src/input/keybinds.rs @@ -65,6 +65,17 @@ impl Keybinds { } ret } + pub fn merge(&mut self, mut other: Keybinds) { + for (other_input_mode, mut other_input_mode_keybinds) in other.0.drain() { + let input_mode_keybinds = self + .0 + .entry(other_input_mode) + .or_insert_with(|| Default::default()); + for (other_action, other_action_keybinds) in other_input_mode_keybinds.drain() { + input_mode_keybinds.insert(other_action, other_action_keybinds); + } + } + } } // The unit test location. |