summaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/input/keybinds.rs
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2022-01-31 16:24:06 +0100
committerGitHub <noreply@github.com>2022-01-31 16:24:06 +0100
commitc82ee774ce320d051e8a89fef9b811c5a576f101 (patch)
tree7d588184a4bc9d596300be81fb1ab6087d755ae0 /zellij-utils/src/input/keybinds.rs
parenta0791e35048dc5f7262328fc9a6ed61d78bd8c1d (diff)
fix(config): warn on mode without actions (#1035)
Log with a warning, if the user finds himself in a mode, that has no action associated with it. fix #949
Diffstat (limited to 'zellij-utils/src/input/keybinds.rs')
-rw-r--r--zellij-utils/src/input/keybinds.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/zellij-utils/src/input/keybinds.rs b/zellij-utils/src/input/keybinds.rs
index 47b7fc3e0..5e8ba033e 100644
--- a/zellij-utils/src/input/keybinds.rs
+++ b/zellij-utils/src/input/keybinds.rs
@@ -198,7 +198,14 @@ impl Keybinds {
keybinds
.0
.get(mode)
- .unwrap_or_else(|| unreachable!("Unrecognized mode: {:?}", mode))
+ .unwrap_or({
+ log::warn!(
+ "The following mode has no action associated with it: {:?}",
+ mode
+ );
+ // create a dummy mode to recover from
+ &ModeKeybinds::new()
+ })
.0
.get(key)
.cloned()