From 24537ec2ba3c24e2dd969b8a78df95dbdae1ac6d Mon Sep 17 00:00:00 2001 From: sodiboo <37938646+sodiboo@users.noreply.github.com> Date: Fri, 1 Mar 2024 12:50:49 +0100 Subject: Correctly handle parsing of Binds and DefaultColumnWidth (#234) * add dev dependencies to flake * parse only one default-column-width * require exactly one action per bind, and unique keys for binds * use proper filename for config errors if possible * fix duplicate keybinds after invalid action, lose some sanity --- src/input.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/input.rs') diff --git a/src/input.rs b/src/input.rs index 45e24485..d832195a 100644 --- a/src/input.rs +++ b/src/input.rs @@ -1650,7 +1650,7 @@ fn bound_action( } if bind_modifiers == modifiers { - return bind.actions.first().cloned(); + return Some(bind.action.clone()); } } @@ -1815,7 +1815,7 @@ mod tests { keysym: close_keysym, modifiers: Modifiers::COMPOSITOR | Modifiers::CTRL, }, - actions: vec![Action::CloseWindow], + action: Action::CloseWindow, }]); let comp_mod = CompositorMod::Super; @@ -1937,35 +1937,35 @@ mod tests { keysym: Keysym::q, modifiers: Modifiers::COMPOSITOR, }, - actions: vec![Action::CloseWindow], + action: Action::CloseWindow, }, Bind { key: Key { keysym: Keysym::h, modifiers: Modifiers::SUPER, }, - actions: vec![Action::FocusColumnLeft], + action: Action::FocusColumnLeft, }, Bind { key: Key { keysym: Keysym::j, modifiers: Modifiers::empty(), }, - actions: vec![Action::FocusWindowDown], + action: Action::FocusWindowDown, }, Bind { key: Key { keysym: Keysym::k, modifiers: Modifiers::COMPOSITOR | Modifiers::SUPER, }, - actions: vec![Action::FocusWindowUp], + action: Action::FocusWindowUp, }, Bind { key: Key { keysym: Keysym::l, modifiers: Modifiers::SUPER | Modifiers::ALT, }, - actions: vec![Action::FocusColumnRight], + action: Action::FocusColumnRight, }, ]); -- cgit