Only use mouse interaction pointer for links if CTRL is used
This commit is contained in:
parent
06b731fadf
commit
244b1a3fad
1 changed files with 12 additions and 10 deletions
|
|
@ -265,17 +265,19 @@ where
|
||||||
&& y >= 0.0
|
&& y >= 0.0
|
||||||
&& y < buffer_size.1.unwrap_or(0.0)
|
&& y < buffer_size.1.unwrap_or(0.0)
|
||||||
{
|
{
|
||||||
let col = x / terminal.size().cell_width;
|
if state.modifiers.contains(Modifiers::CTRL) {
|
||||||
let row = y / terminal.size().cell_height;
|
let col = x / terminal.size().cell_width;
|
||||||
|
let row = y / terminal.size().cell_height;
|
||||||
|
|
||||||
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(_) = terminal
|
if terminal
|
||||||
.regex_matches
|
.regex_matches
|
||||||
.iter()
|
.iter()
|
||||||
.find(|bounds| bounds.contains(&location))
|
.any(|bounds| bounds.contains(&location))
|
||||||
{
|
{
|
||||||
return mouse::Interaction::Pointer;
|
return mouse::Interaction::Pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return mouse::Interaction::Text;
|
return mouse::Interaction::Text;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue