mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-18 13:55:23 -05:00
Fix number-based mouse bindings
The toml migration introduced a regression which stopped numbered key binding's from working. This patch implements the required number type to make things work again. Fixes #7527.
This commit is contained in:
parent
659550ee34
commit
8f57367ead
2 changed files with 11 additions and 0 deletions
|
@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
- Blurry window when using `window.dimensions` on some Wayland compositors
|
- Blurry window when using `window.dimensions` on some Wayland compositors
|
||||||
- IME input lagging behind on X11
|
- IME input lagging behind on X11
|
||||||
- xdotool modifiers input not working correctly on X11
|
- xdotool modifiers input not working correctly on X11
|
||||||
|
- Parsing numbers fails for mouse bindings
|
||||||
|
|
||||||
## 0.13.0
|
## 0.13.0
|
||||||
|
|
||||||
|
|
|
@ -860,6 +860,16 @@ impl<'a> Deserialize<'a> for MouseButtonWrapper {
|
||||||
f.write_str("Left, Right, Middle, Back, Forward, or a number from 0 to 65536")
|
f.write_str("Left, Right, Middle, Back, Forward, or a number from 0 to 65536")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn visit_i64<E>(self, value: i64) -> Result<MouseButtonWrapper, E>
|
||||||
|
where
|
||||||
|
E: de::Error,
|
||||||
|
{
|
||||||
|
match value {
|
||||||
|
0..=65536 => Ok(MouseButtonWrapper(MouseButton::Other(value as u16))),
|
||||||
|
_ => Err(E::invalid_value(Unexpected::Signed(value), &self)),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn visit_u64<E>(self, value: u64) -> Result<MouseButtonWrapper, E>
|
fn visit_u64<E>(self, value: u64) -> Result<MouseButtonWrapper, E>
|
||||||
where
|
where
|
||||||
E: de::Error,
|
E: de::Error,
|
||||||
|
|
Loading…
Reference in a new issue