diff options
author | Lars Francke <lars.francke@stackable.tech> | 2024-01-02 06:55:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-02 05:55:02 +0000 |
commit | 8f57367eadeca92706193fc40030081f40e81fbf (patch) | |
tree | dd455c1ea059218ea659219457a202521d6b9059 | |
parent | 659550ee34fe1b45ea176b88e60901d277d210a3 (diff) | |
download | alacritty-8f57367eadeca92706193fc40030081f40e81fbf.tar.gz alacritty-8f57367eadeca92706193fc40030081f40e81fbf.zip |
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.
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | alacritty/src/config/bindings.rs | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index f988f21d..49dddcce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 - IME input lagging behind on X11 - xdotool modifiers input not working correctly on X11 +- Parsing numbers fails for mouse bindings ## 0.13.0 diff --git a/alacritty/src/config/bindings.rs b/alacritty/src/config/bindings.rs index b75676a3..f58744e5 100644 --- a/alacritty/src/config/bindings.rs +++ b/alacritty/src/config/bindings.rs @@ -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") } + 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> where E: de::Error, |