From 7c9d9f3b166f2aade76d35408b5acb5d3ccd1c94 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Wed, 6 Dec 2023 01:36:28 +0400 Subject: Fix chars usage inside the mouse bindings Fixes #7413. --- CHANGELOG.md | 1 + alacritty/src/config/bindings.rs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58d0a70e..238769ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 - Cursor not updating when blinking and viewport is scrolled - Failure to start with recent version of mesa's i915 driver +- Error when using `chars` inside the mouse bindings ### Removed diff --git a/alacritty/src/config/bindings.rs b/alacritty/src/config/bindings.rs index a84e967a..d836c5e6 100644 --- a/alacritty/src/config/bindings.rs +++ b/alacritty/src/config/bindings.rs @@ -899,7 +899,7 @@ impl<'a> Deserialize<'a> for MouseButtonWrapper { type Value = MouseButtonWrapper; 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(self, value: u64) -> Result @@ -920,6 +920,8 @@ impl<'a> Deserialize<'a> for MouseButtonWrapper { "Left" => Ok(MouseButtonWrapper(MouseButton::Left)), "Right" => Ok(MouseButtonWrapper(MouseButton::Right)), "Middle" => Ok(MouseButtonWrapper(MouseButton::Middle)), + "Back" => Ok(MouseButtonWrapper(MouseButton::Back)), + "Forward" => Ok(MouseButtonWrapper(MouseButton::Forward)), _ => Err(E::invalid_value(Unexpected::Str(value), &self)), } } @@ -1134,7 +1136,7 @@ impl<'a> Deserialize<'a> for RawBinding { chars = Some(map.next_value()?); }, Field::Mouse => { - if chars.is_some() { + if mouse.is_some() { return Err(::duplicate_field("mouse")); } -- cgit v1.2.3