mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-10 20:29:05 +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),
|
ScrollToPoint(Point),
|
||||||
SetSelection(Option<(Selection, Point)>),
|
SetSelection(Option<(Selection, Point)>),
|
||||||
UpdateSelection(Vector2F),
|
UpdateSelection(Vector2F),
|
||||||
HyperlinkHover(Vector2F),
|
Hyperlink(Vector2F, bool),
|
||||||
Copy,
|
Copy,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -649,7 +649,7 @@ impl Terminal {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InternalEvent::ScrollToPoint(point) => term.scroll_to_point(*point),
|
InternalEvent::ScrollToPoint(point) => term.scroll_to_point(*point),
|
||||||
InternalEvent::HyperlinkHover(position) => {
|
InternalEvent::Hyperlink(position, _hover) => {
|
||||||
let point = grid_point(
|
let point = grid_point(
|
||||||
*position,
|
*position,
|
||||||
self.last_content.size,
|
self.last_content.size,
|
||||||
|
@ -657,7 +657,7 @@ impl Terminal {
|
||||||
);
|
);
|
||||||
let side = mouse_side(*position, self.last_content.size);
|
let side = mouse_side(*position, self.last_content.size);
|
||||||
|
|
||||||
println!("Hyperlink hover")
|
println!("Hyperlink hover | click ")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -878,7 +878,7 @@ impl Terminal {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
self.events
|
self.events
|
||||||
.push_back(InternalEvent::HyperlinkHover(position));
|
.push_back(InternalEvent::Hyperlink(position, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -955,6 +955,9 @@ impl Terminal {
|
||||||
dbg!(&link);
|
dbg!(&link);
|
||||||
dbg!(&self.last_hovered_hyperlink);
|
dbg!(&self.last_hovered_hyperlink);
|
||||||
open_uri(link.uri()).log_err();
|
open_uri(link.uri()).log_err();
|
||||||
|
} else {
|
||||||
|
self.events
|
||||||
|
.push_back(InternalEvent::Hyperlink(position, true));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let point = grid_point(
|
let point = grid_point(
|
||||||
|
|
Loading…
Reference in a new issue