diff options
| author | sodiboo <37938646+sodiboo@users.noreply.github.com> | 2024-03-01 12:50:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-01 03:50:49 -0800 |
| commit | 24537ec2ba3c24e2dd969b8a78df95dbdae1ac6d (patch) | |
| tree | c0e4b23e4dee60e591a609bc717874c18edb312b /src/input.rs | |
| parent | 88ac16c99a4a86f61a38ac4584bf13a9358f6236 (diff) | |
| download | niri-24537ec2ba3c24e2dd969b8a78df95dbdae1ac6d.tar.gz niri-24537ec2ba3c24e2dd969b8a78df95dbdae1ac6d.tar.bz2 niri-24537ec2ba3c24e2dd969b8a78df95dbdae1ac6d.zip | |
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
Diffstat (limited to 'src/input.rs')
| -rw-r--r-- | src/input.rs | 14 |
1 files changed, 7 insertions, 7 deletions
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, }, ]); |
