mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-05 10:20:51 +00:00
Reworking hyperlink events
This commit is contained in:
parent
b8f362fd84
commit
ba32dcbb88
1 changed files with 7 additions and 4 deletions
|
@ -110,7 +110,7 @@ enum InternalEvent {
|
|||
ScrollToPoint(Point),
|
||||
SetSelection(Option<(Selection, Point)>),
|
||||
UpdateSelection(Vector2F),
|
||||
HyperlinkHover(Vector2F),
|
||||
Hyperlink(Vector2F, bool),
|
||||
Copy,
|
||||
}
|
||||
|
||||
|
@ -649,7 +649,7 @@ impl Terminal {
|
|||
}
|
||||
}
|
||||
InternalEvent::ScrollToPoint(point) => term.scroll_to_point(*point),
|
||||
InternalEvent::HyperlinkHover(position) => {
|
||||
InternalEvent::Hyperlink(position, _hover) => {
|
||||
let point = grid_point(
|
||||
*position,
|
||||
self.last_content.size,
|
||||
|
@ -657,7 +657,7 @@ impl Terminal {
|
|||
);
|
||||
let side = mouse_side(*position, self.last_content.size);
|
||||
|
||||
println!("Hyperlink hover")
|
||||
println!("Hyperlink hover | click ")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -878,7 +878,7 @@ impl Terminal {
|
|||
});
|
||||
} else {
|
||||
self.events
|
||||
.push_back(InternalEvent::HyperlinkHover(position));
|
||||
.push_back(InternalEvent::Hyperlink(position, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -955,6 +955,9 @@ impl Terminal {
|
|||
dbg!(&link);
|
||||
dbg!(&self.last_hovered_hyperlink);
|
||||
open_uri(link.uri()).log_err();
|
||||
} else {
|
||||
self.events
|
||||
.push_back(InternalEvent::Hyperlink(position, true));
|
||||
}
|
||||
} else {
|
||||
let point = grid_point(
|
||||
|
|
Loading…
Reference in a new issue