summaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/ansi.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-12-31 05:52:45 +0000
committerGitHub <noreply@github.com>2020-12-31 05:52:45 +0000
commit1723e30d25f0c6068f9532448b016a89aa491a95 (patch)
tree543790b11a4fdc3c82f7f0b0ebc1cbc79d1c2009 /alacritty_terminal/src/ansi.rs
parent0aa1df327bf5c3e7892ad13d949be7e598aafda9 (diff)
downloadalacritty-1723e30d25f0c6068f9532448b016a89aa491a95.tar.gz
alacritty-1723e30d25f0c6068f9532448b016a89aa491a95.zip
Use ConfigDeserialize for all config enums
This fixes up all of the remaining enums which are used in the configuration file to make sure they all support fully case insensitive deserialization. Fixes #4611.
Diffstat (limited to 'alacritty_terminal/src/ansi.rs')
-rw-r--r--alacritty_terminal/src/ansi.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs
index 21f0ec45..2bd445ea 100644
--- a/alacritty_terminal/src/ansi.rs
+++ b/alacritty_terminal/src/ansi.rs
@@ -7,6 +7,8 @@ use log::{debug, trace};
use serde::{Deserialize, Serialize};
use vte::{Params, ParamsIter};
+use alacritty_config_derive::ConfigDeserialize;
+
use crate::index::{Column, Line};
use crate::term::color::Rgb;
@@ -332,14 +334,14 @@ pub trait Handler {
}
/// Terminal cursor configuration.
-#[derive(Deserialize, Default, Debug, Eq, PartialEq, Copy, Clone, Hash)]
+#[derive(ConfigDeserialize, Default, Debug, Eq, PartialEq, Copy, Clone, Hash)]
pub struct CursorStyle {
pub shape: CursorShape,
pub blinking: bool,
}
/// Terminal cursor shape.
-#[derive(Deserialize, Debug, Eq, PartialEq, Copy, Clone, Hash)]
+#[derive(ConfigDeserialize, Debug, Eq, PartialEq, Copy, Clone, Hash)]
pub enum CursorShape {
/// Cursor is a block like `▒`.
Block,
@@ -351,11 +353,11 @@ pub enum CursorShape {
Beam,
/// Cursor is a box like `☐`.
- #[serde(skip)]
+ #[config(skip)]
HollowBlock,
/// Invisible cursor.
- #[serde(skip)]
+ #[config(skip)]
Hidden,
}
@@ -509,7 +511,7 @@ pub enum TabulationClearMode {
///
/// The order here matters since the enum should be castable to a `usize` for
/// indexing a color list.
-#[derive(Debug, Copy, Clone, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize)]
+#[derive(Serialize, Deserialize, Debug, Copy, Clone, Eq, PartialEq, PartialOrd, Ord)]
pub enum NamedColor {
/// Black.
Black = 0,
@@ -621,7 +623,7 @@ impl NamedColor {
}
}
-#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq)]
pub enum Color {
Named(NamedColor),
Spec(Rgb),