diff options
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. |