mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-06 02:37:21 +00:00
Slightly improved left click handling
This commit is contained in:
parent
4bc0afdafa
commit
550ae40ff5
1 changed files with 5 additions and 3 deletions
|
@ -1015,8 +1015,7 @@ impl Terminal {
|
||||||
pub fn left_click(&mut self, e: &ClickRegionEvent, origin: Vector2F) {
|
pub fn left_click(&mut self, e: &ClickRegionEvent, origin: Vector2F) {
|
||||||
let position = e.position.sub(origin);
|
let position = e.position.sub(origin);
|
||||||
if !self.mouse_mode(e.shift) {
|
if !self.mouse_mode(e.shift) {
|
||||||
if self.last_content.last_hovered_hyperlink.is_some()
|
//Hyperlinks
|
||||||
&& self.last_content.selection.is_none()
|
|
||||||
{
|
{
|
||||||
let mouse_cell_index = content_index_for_mouse(position, &self.last_content);
|
let mouse_cell_index = content_index_for_mouse(position, &self.last_content);
|
||||||
if let Some(link) = self.last_content.cells[mouse_cell_index].hyperlink() {
|
if let Some(link) = self.last_content.cells[mouse_cell_index].hyperlink() {
|
||||||
|
@ -1025,7 +1024,10 @@ impl Terminal {
|
||||||
self.events
|
self.events
|
||||||
.push_back(InternalEvent::Hyperlink(position, true));
|
.push_back(InternalEvent::Hyperlink(position, true));
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
// Selections
|
||||||
|
{
|
||||||
let point = grid_point(
|
let point = grid_point(
|
||||||
position,
|
position,
|
||||||
self.last_content.size,
|
self.last_content.size,
|
||||||
|
|
Loading…
Reference in a new issue