mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 21:13:02 +00:00
Change mouse cursor when link is visible
This commit is contained in:
parent
a190eb0537
commit
a8ea1048cf
2 changed files with 10 additions and 2 deletions
|
@ -427,9 +427,14 @@ impl EditorElement {
|
|||
let content_origin = bounds.origin() + vec2f(layout.gutter_margin, 0.);
|
||||
|
||||
cx.scene.push_layer(Some(bounds));
|
||||
|
||||
cx.scene.push_cursor_region(CursorRegion {
|
||||
bounds,
|
||||
style: CursorStyle::IBeam,
|
||||
style: if !view.link_go_to_definition_state.definitions.is_empty() {
|
||||
CursorStyle::PointingHand
|
||||
} else {
|
||||
CursorStyle::IBeam
|
||||
},
|
||||
});
|
||||
|
||||
for (range, color) in &layout.highlighted_ranges {
|
||||
|
|
|
@ -237,8 +237,11 @@ pub fn show_link_definition(
|
|||
}
|
||||
|
||||
pub fn hide_link_definition(editor: &mut Editor, cx: &mut ViewContext<Editor>) {
|
||||
if editor.link_go_to_definition_state.symbol_range.is_some() {
|
||||
if editor.link_go_to_definition_state.symbol_range.is_some()
|
||||
|| !editor.link_go_to_definition_state.definitions.is_empty()
|
||||
{
|
||||
editor.link_go_to_definition_state.symbol_range.take();
|
||||
editor.link_go_to_definition_state.definitions.clear();
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue