Merge pull request #557 from snaggen/ctrl-link
Hide opening hyperlinks behind the Ctrl modifier
This commit is contained in:
commit
df7be3fca5
1 changed files with 13 additions and 10 deletions
|
|
@ -1092,16 +1092,19 @@ where
|
||||||
|
|
||||||
let location = terminal
|
let location = terminal
|
||||||
.viewport_to_point(TermPoint::new(row as usize, TermColumn(col as usize)));
|
.viewport_to_point(TermPoint::new(row as usize, TermColumn(col as usize)));
|
||||||
if let Some(on_open_hyperlink) = &self.on_open_hyperlink {
|
if state.modifiers.control() {
|
||||||
if let Some(match_) = terminal
|
if let Some(on_open_hyperlink) = &self.on_open_hyperlink {
|
||||||
.regex_matches
|
if let Some(match_) = terminal
|
||||||
.iter()
|
.regex_matches
|
||||||
.find(|bounds| bounds.contains(&location))
|
.iter()
|
||||||
{
|
.find(|bounds| bounds.contains(&location))
|
||||||
let term = terminal.term.lock();
|
{
|
||||||
let hyperlink = term.bounds_to_string(*match_.start(), *match_.end());
|
let term = terminal.term.lock();
|
||||||
shell.publish(on_open_hyperlink(hyperlink));
|
let hyperlink =
|
||||||
status = Status::Captured;
|
term.bounds_to_string(*match_.start(), *match_.end());
|
||||||
|
shell.publish(on_open_hyperlink(hyperlink));
|
||||||
|
status = Status::Captured;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue