aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/vi_mode.rs
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2023-11-10 18:16:22 +0400
committerGitHub <noreply@github.com>2023-11-10 18:16:22 +0400
commit5060f8eeb864e8c304fbad9588bdd882db942356 (patch)
treeb615ded19e6ac545b495f716e2a22ecd903332af /alacritty_terminal/src/vi_mode.rs
parent3ffd6c8f26f9788466b9ba95659b8de970a10f08 (diff)
downloadalacritty-5060f8eeb864e8c304fbad9588bdd882db942356.tar.gz
alacritty-5060f8eeb864e8c304fbad9588bdd882db942356.zip
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.
Diffstat (limited to 'alacritty_terminal/src/vi_mode.rs')
-rw-r--r--alacritty_terminal/src/vi_mode.rs13
1 files changed, 7 insertions, 6 deletions
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<T>(term: &Term<T>, 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<VoidListener> {
let size = TermSize::new(20, 20);
- Term::new(&Config::default(), &size, VoidListener)
+ Term::new(Config::default(), &size, VoidListener)
}
#[test]