diff options
author | Anhad Singh <62820092+Andy-Python-Programmer@users.noreply.github.com> | 2023-05-24 06:35:58 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-23 20:35:58 +0000 |
commit | cb7ad5b7e6893787c2006cc8cb09fbbc4711c0f7 (patch) | |
tree | e8c5315bb620e6d4e1564dfd6825303b498a3d6d /alacritty_terminal/src/config/mod.rs | |
parent | f0379f2da751e81ba05bbf65ecb5e59590f39be4 (diff) | |
download | alacritty-cb7ad5b7e6893787c2006cc8cb09fbbc4711c0f7.tar.gz alacritty-cb7ad5b7e6893787c2006cc8cb09fbbc4711c0f7.zip |
Switch to VTE's built-in ansi feature
Co-authored-by: Christian Duerr <contact@christianduerr.com>
Diffstat (limited to 'alacritty_terminal/src/config/mod.rs')
-rw-r--r-- | alacritty_terminal/src/config/mod.rs | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/alacritty_terminal/src/config/mod.rs b/alacritty_terminal/src/config/mod.rs index f17c327f..2d921b6e 100644 --- a/alacritty_terminal/src/config/mod.rs +++ b/alacritty_terminal/src/config/mod.rs @@ -8,7 +8,7 @@ use alacritty_config_derive::{ConfigDeserialize, SerdeReplace}; mod scrolling; -use crate::ansi::{CursorShape, CursorStyle}; +use crate::ansi::{CursorShapeShim, CursorStyle}; pub use crate::config::scrolling::{Scrolling, MAX_SCROLLBACK_LINES}; @@ -129,10 +129,10 @@ impl Cursor { #[derive(SerdeReplace, Deserialize, Debug, Copy, Clone, PartialEq, Eq)] #[serde(untagged)] pub enum ConfigCursorStyle { - Shape(CursorShape), + Shape(CursorShapeShim), WithBlinking { #[serde(default)] - shape: CursorShape, + shape: CursorShapeShim, #[serde(default)] blinking: CursorBlinking, }, @@ -140,7 +140,7 @@ pub enum ConfigCursorStyle { impl Default for ConfigCursorStyle { fn default() -> Self { - Self::Shape(CursorShape::default()) + Self::Shape(CursorShapeShim::default()) } } @@ -157,28 +157,23 @@ impl ConfigCursorStyle { impl From<ConfigCursorStyle> for CursorStyle { fn from(config_style: ConfigCursorStyle) -> Self { match config_style { - ConfigCursorStyle::Shape(shape) => Self { shape, blinking: false }, + ConfigCursorStyle::Shape(shape) => Self { shape: shape.into(), blinking: false }, ConfigCursorStyle::WithBlinking { shape, blinking } => { - Self { shape, blinking: blinking.into() } + Self { shape: shape.into(), blinking: blinking.into() } }, } } } -#[derive(ConfigDeserialize, Debug, Copy, Clone, PartialEq, Eq)] +#[derive(ConfigDeserialize, Default, Debug, Copy, Clone, PartialEq, Eq)] pub enum CursorBlinking { Never, + #[default] Off, On, Always, } -impl Default for CursorBlinking { - fn default() -> Self { - CursorBlinking::Off - } -} - impl CursorBlinking { fn blinking_override(&self) -> Option<bool> { match self { |