Browse Source

shortcut!: prevent panic if shortcut key $section is missing

memfd
Manos Pitsidianakis 1 year ago
parent
commit
315af9bc05
Signed by untrusted user: epilys GPG Key ID: 73627C2F690DF710
  1. 6
      src/conf/shortcuts.rs

6
src/conf/shortcuts.rs

@ -27,9 +27,9 @@ use melib::{MeliError, Result};
#[macro_export]
macro_rules! shortcut {
($key:ident == $shortcuts:ident[$section:expr][$val:literal]) => {
$shortcuts[$section]
.get($val)
.map(|v| v == $key)
$shortcuts
.get($section)
.and_then(|s| s.get($val).map(|v| v == $key))
.unwrap_or(false)
};
}

Loading…
Cancel
Save