From c82ee774ce320d051e8a89fef9b811c5a576f101 Mon Sep 17 00:00:00 2001 From: a-kenji Date: Mon, 31 Jan 2022 16:24:06 +0100 Subject: 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 --- zellij-utils/src/input/keybinds.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'zellij-utils/src/input/keybinds.rs') 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() -- cgit v1.2.3