diff options
author | Christian Duerr <contact@christianduerr.com> | 2023-04-09 22:29:48 +0200 |
---|---|---|
committer | Kirill Chibisov <contact@kchibisov.com> | 2023-04-15 03:09:27 +0300 |
commit | 586f982a260a1864f61f9aff6a861d3231bf3301 (patch) | |
tree | ce8a6accf9a03db01fc1b92d2250f0e17b9f8b46 /alacritty/src/config/bindings.rs | |
parent | 8b0305d3f01bbeaedabca8dee4619bb03d8c0561 (diff) | |
download | r-alacritty-586f982a260a1864f61f9aff6a861d3231bf3301.tar.gz r-alacritty-586f982a260a1864f61f9aff6a861d3231bf3301.tar.bz2 r-alacritty-586f982a260a1864f61f9aff6a861d3231bf3301.zip |
Allow mode-exclusive bindings in any mode
This patch enables binding chains that go beyond mode changes by
allowing bindings to be defined for modes they do not usually have an
effect in.
Diffstat (limited to 'alacritty/src/config/bindings.rs')
-rw-r--r-- | alacritty/src/config/bindings.rs | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/alacritty/src/config/bindings.rs b/alacritty/src/config/bindings.rs index e3ee41e7..0e50807a 100644 --- a/alacritty/src/config/bindings.rs +++ b/alacritty/src/config/bindings.rs @@ -1114,26 +1114,8 @@ impl<'a> Deserialize<'a> for RawBinding { let action = match (action, chars, command) { (Some(action @ Action::ViMotion(_)), None, None) - | (Some(action @ Action::Vi(_)), None, None) => { - if !mode.intersects(BindingMode::VI) || not_mode.intersects(BindingMode::VI) - { - return Err(V::Error::custom(format!( - "action `{}` is only available in vi mode, try adding `mode: Vi`", - action, - ))); - } - action - }, - (Some(action @ Action::Search(_)), None, None) => { - if !mode.intersects(BindingMode::SEARCH) { - return Err(V::Error::custom(format!( - "action `{}` is only available in search mode, try adding `mode: \ - Search`", - action, - ))); - } - action - }, + | (Some(action @ Action::Vi(_)), None, None) => action, + (Some(action @ Action::Search(_)), None, None) => action, (Some(action @ Action::Mouse(_)), None, None) => { if mouse.is_none() { return Err(V::Error::custom(format!( |