WIP Hyperlinks

This commit is contained in:
Mikayla Maki 2022-09-19 09:07:41 -07:00
parent 1993a870e1
commit 9f81f39f51

View file

@ -43,7 +43,7 @@ use std::{
collections::{HashMap, VecDeque}, collections::{HashMap, VecDeque},
fmt::Display, fmt::Display,
io, io,
ops::{Deref, RangeInclusive, Sub}, ops::{Deref, Range, RangeInclusive, Sub},
os::unix::{prelude::AsRawFd, process::CommandExt}, os::unix::{prelude::AsRawFd, process::CommandExt},
path::PathBuf, path::PathBuf,
process::Command, process::Command,
@ -493,7 +493,7 @@ pub struct Terminal {
pub matches: Vec<RangeInclusive<Point>>, pub matches: Vec<RangeInclusive<Point>>,
last_content: TerminalContent, last_content: TerminalContent,
last_synced: Instant, last_synced: Instant,
last_hovered_hyperlink: Option<Hyperlink>, last_hovered_hyperlink: Option<(Hyperlink, Range<Point>)>,
sync_task: Option<Task<()>>, sync_task: Option<Task<()>>,
selection_head: Option<Point>, selection_head: Option<Point>,
breadcrumb_text: String, breadcrumb_text: String,
@ -832,7 +832,7 @@ impl Terminal {
} }
} }
} else if e.cmd { } else if e.cmd {
self.last_hovered_hyperlink = cell_for_mouse(e.position, &self.last_content) let hyperlink = cell_for_mouse(e.position, &self.last_content)
.cell .cell
.hyperlink(); .hyperlink();
} }