aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/ansi.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/ansi.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/ansi.rs')
-rw-r--r--alacritty_terminal/src/ansi.rs60
1 files changed, 0 insertions, 60 deletions
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs
deleted file mode 100644
index 694520bd..00000000
--- a/alacritty_terminal/src/ansi.rs
+++ /dev/null
@@ -1,60 +0,0 @@
-//! ANSI Terminal Stream Parsing.
-
-pub use vte::ansi::*;
-
-#[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)]
-pub struct CursorShapeShim(CursorShape);
-
-impl Default for CursorShapeShim {
- fn default() -> CursorShapeShim {
- CursorShapeShim(CursorShape::Block)
- }
-}
-
-impl From<CursorShapeShim> for CursorShape {
- fn from(value: CursorShapeShim) -> Self {
- value.0
- }
-}
-
-struct CursorShapeVisitor;
-
-impl<'de> serde::de::Visitor<'de> for CursorShapeVisitor {
- type Value = CursorShapeShim;
-
- fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- formatter.write_str("one of `Block`, `Underline`, `Beam`")
- }
-
- fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
- where
- E: serde::de::Error,
- {
- match s.to_lowercase().as_str() {
- "block" => Ok(CursorShapeShim(CursorShape::Block)),
- "underline" => Ok(CursorShapeShim(CursorShape::Underline)),
- "beam" => Ok(CursorShapeShim(CursorShape::Beam)),
- _ => Err(E::custom(format!(
- "unknown variant `{0}`, expected {1}",
- s, "one of `Block`, `Underline`, `Beam`"
- ))),
- }
- }
-}
-
-impl<'de> serde::Deserialize<'de> for CursorShapeShim {
- fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
- where
- D: serde::Deserializer<'de>,
- {
- deserializer.deserialize_str(CursorShapeVisitor)
- }
-}
-
-impl alacritty_config::SerdeReplace for CursorShapeShim {
- fn replace(&mut self, value: toml::Value) -> Result<(), Box<dyn std::error::Error>> {
- *self = serde::Deserialize::deserialize(value)?;
-
- Ok(())
- }
-}