mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-10-08 10:46:43 +02:00
use Binding::new
This commit is contained in:
parent
326b166686
commit
353a20bab9
1 changed files with 5 additions and 11 deletions
16
src/tek.rs
16
src/tek.rs
|
|
@ -932,16 +932,12 @@ pub trait DispatchBind<C: Clone>: HasBinds + HasModeStack + HasModes + Namespace
|
|||
-> Option<Arc<[Binding<Arc<str>>]>>
|
||||
{
|
||||
let axis = self.binds_axis().read();
|
||||
for (ctrl, _param) in mode.axis.iter() {
|
||||
if let Some(axis) = axis.get(ctrl) {
|
||||
for (name, _param) in mode.axis.iter() {
|
||||
if let Some(axis) = axis.get(name) {
|
||||
if *input == axis.0 {
|
||||
return Some([Binding {
|
||||
commands: [].into(), ..Default::default()
|
||||
}].into())
|
||||
return Some([Binding::new([format!("(dec {name})").into()].into())].into())
|
||||
} else if *input == axis.1 {
|
||||
return Some([Binding {
|
||||
commands: [].into(), ..Default::default()
|
||||
}].into())
|
||||
return Some([Binding::new([format!("(inc {name})").into()].into())].into())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -971,9 +967,7 @@ pub trait DispatchBind<C: Clone>: HasBinds + HasModeStack + HasModes + Namespace
|
|||
&& let Ok(Some(head)) = expr.head()
|
||||
&& *input == head.into()
|
||||
&& let Ok(Some(tail)) = expr.tail() {
|
||||
return Some([Binding {
|
||||
commands: [tail.into()].into(), ..Default::default()
|
||||
}].into())
|
||||
return Some([Binding::new([tail.into()].into())].into())
|
||||
}
|
||||
}
|
||||
None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue