Skip to content

Commit

Permalink
fix(config): warn on mode without actions
Browse files Browse the repository at this point in the history
Log with a warning, if the user finds himself in a mode,
that has no action associated with it.

fix #949
  • Loading branch information
a-kenji committed Jan 31, 2022
1 parent a0791e3 commit cecb8ff
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion zellij-utils/src/input/keybinds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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().clone()
})
.0
.get(key)
.cloned()
Expand Down

0 comments on commit cecb8ff

Please sign in to comment.