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/term/cell.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/term/cell.rs')
-rw-r--r-- | alacritty_terminal/src/term/cell.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/alacritty_terminal/src/term/cell.rs b/alacritty_terminal/src/term/cell.rs index 5253ede1..ddf6a745 100644 --- a/alacritty_terminal/src/term/cell.rs +++ b/alacritty_terminal/src/term/cell.rs @@ -3,6 +3,7 @@ use std::sync::Arc; use bitflags::bitflags; use serde::{Deserialize, Serialize}; +use vte::ansi::Hyperlink as VteHyperlink; use crate::ansi::{Color, NamedColor}; use crate::grid::{self, GridCell}; @@ -57,6 +58,18 @@ impl Hyperlink { } } +impl From<VteHyperlink> for Hyperlink { + fn from(value: VteHyperlink) -> Self { + Self::new(value.id, value.uri) + } +} + +impl From<Hyperlink> for VteHyperlink { + fn from(val: Hyperlink) -> Self { + VteHyperlink { id: Some(val.id().to_owned()), uri: val.uri().to_owned() } + } +} + #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Hash)] struct HyperlinkInner { /// Identifier for the given hyperlink. |