1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

Fix chars usage inside the mouse bindings

Fixes #7413.
This commit is contained in:
Kirill Chibisov 2023-12-06 01:36:28 +04:00 committed by GitHub
parent f94f4fd4be
commit 7c9d9f3b16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -74,6 +74,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Vi cursor position not redrawn on PageUp/PageDown without scrollback - Vi cursor position not redrawn on PageUp/PageDown without scrollback
- Cursor not updating when blinking and viewport is scrolled - Cursor not updating when blinking and viewport is scrolled
- Failure to start with recent version of mesa's i915 driver - Failure to start with recent version of mesa's i915 driver
- Error when using `chars` inside the mouse bindings
### Removed ### Removed

View file

@ -899,7 +899,7 @@ impl<'a> Deserialize<'a> for MouseButtonWrapper {
type Value = MouseButtonWrapper; type Value = MouseButtonWrapper;
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("Left, Right, Middle, or a number from 0 to 65536") f.write_str("Left, Right, Middle, Back, Forward, or a number from 0 to 65536")
} }
fn visit_u64<E>(self, value: u64) -> Result<MouseButtonWrapper, E> fn visit_u64<E>(self, value: u64) -> Result<MouseButtonWrapper, E>
@ -920,6 +920,8 @@ impl<'a> Deserialize<'a> for MouseButtonWrapper {
"Left" => Ok(MouseButtonWrapper(MouseButton::Left)), "Left" => Ok(MouseButtonWrapper(MouseButton::Left)),
"Right" => Ok(MouseButtonWrapper(MouseButton::Right)), "Right" => Ok(MouseButtonWrapper(MouseButton::Right)),
"Middle" => Ok(MouseButtonWrapper(MouseButton::Middle)), "Middle" => Ok(MouseButtonWrapper(MouseButton::Middle)),
"Back" => Ok(MouseButtonWrapper(MouseButton::Back)),
"Forward" => Ok(MouseButtonWrapper(MouseButton::Forward)),
_ => Err(E::invalid_value(Unexpected::Str(value), &self)), _ => Err(E::invalid_value(Unexpected::Str(value), &self)),
} }
} }
@ -1134,7 +1136,7 @@ impl<'a> Deserialize<'a> for RawBinding {
chars = Some(map.next_value()?); chars = Some(map.next_value()?);
}, },
Field::Mouse => { Field::Mouse => {
if chars.is_some() { if mouse.is_some() {
return Err(<V::Error as Error>::duplicate_field("mouse")); return Err(<V::Error as Error>::duplicate_field("mouse"));
} }