mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-10-08 18:56:42 +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>>]>>
|
-> Option<Arc<[Binding<Arc<str>>]>>
|
||||||
{
|
{
|
||||||
let axis = self.binds_axis().read();
|
let axis = self.binds_axis().read();
|
||||||
for (ctrl, _param) in mode.axis.iter() {
|
for (name, _param) in mode.axis.iter() {
|
||||||
if let Some(axis) = axis.get(ctrl) {
|
if let Some(axis) = axis.get(name) {
|
||||||
if *input == axis.0 {
|
if *input == axis.0 {
|
||||||
return Some([Binding {
|
return Some([Binding::new([format!("(dec {name})").into()].into())].into())
|
||||||
commands: [].into(), ..Default::default()
|
|
||||||
}].into())
|
|
||||||
} else if *input == axis.1 {
|
} else if *input == axis.1 {
|
||||||
return Some([Binding {
|
return Some([Binding::new([format!("(inc {name})").into()].into())].into())
|
||||||
commands: [].into(), ..Default::default()
|
|
||||||
}].into())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -971,9 +967,7 @@ pub trait DispatchBind<C: Clone>: HasBinds + HasModeStack + HasModes + Namespace
|
||||||
&& let Ok(Some(head)) = expr.head()
|
&& let Ok(Some(head)) = expr.head()
|
||||||
&& *input == head.into()
|
&& *input == head.into()
|
||||||
&& let Ok(Some(tail)) = expr.tail() {
|
&& let Ok(Some(tail)) = expr.tail() {
|
||||||
return Some([Binding {
|
return Some([Binding::new([tail.into()].into())].into())
|
||||||
commands: [tail.into()].into(), ..Default::default()
|
|
||||||
}].into())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue