From 5060f8eeb864e8c304fbad9588bdd882db942356 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Fri, 10 Nov 2023 18:16:22 +0400 Subject: Remove `alacritty_config` from alacritty_terminal There's no need to force alacritty's user configuration on other users of the crate, thus provide the options actually used by alacritty_terminal itself. --- alacritty_terminal/src/vi_mode.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'alacritty_terminal/src/vi_mode.rs') diff --git a/alacritty_terminal/src/vi_mode.rs b/alacritty_terminal/src/vi_mode.rs index d4f66d9e..7065544e 100644 --- a/alacritty_terminal/src/vi_mode.rs +++ b/alacritty_terminal/src/vi_mode.rs @@ -1,6 +1,7 @@ use std::cmp::min; -use alacritty_config_derive::ConfigDeserialize; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; use crate::event::EventListener; use crate::grid::{Dimensions, GridCell}; @@ -9,7 +10,8 @@ use crate::term::cell::Flags; use crate::term::Term; /// Possible vi mode motion movements. -#[derive(ConfigDeserialize, Debug, Copy, Clone, PartialEq, Eq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "lowercase"))] pub enum ViMotion { /// Move up. Up, @@ -379,16 +381,15 @@ fn is_boundary(term: &Term, point: Point, direction: Direction) -> bool { mod tests { use super::*; - use crate::ansi::Handler; - use crate::config::Config; use crate::event::VoidListener; use crate::index::{Column, Line}; use crate::term::test::TermSize; - use crate::term::Term; + use crate::term::{Config, Term}; + use crate::vte::ansi::Handler; fn term() -> Term { let size = TermSize::new(20, 20); - Term::new(&Config::default(), &size, VoidListener) + Term::new(Config::default(), &size, VoidListener) } #[test] -- cgit v1.2.3-54-g00ecf