aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/term/cell.rs
diff options
context:
space:
mode:
authorAnhad Singh <62820092+Andy-Python-Programmer@users.noreply.github.com>2023-05-24 06:35:58 +1000
committerGitHub <noreply@github.com>2023-05-23 20:35:58 +0000
commitcb7ad5b7e6893787c2006cc8cb09fbbc4711c0f7 (patch)
treee8c5315bb620e6d4e1564dfd6825303b498a3d6d /alacritty_terminal/src/term/cell.rs
parentf0379f2da751e81ba05bbf65ecb5e59590f39be4 (diff)
downloadalacritty-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.rs13
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.