mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 06:05:19 +00:00
Properly handle hover-less areas hover
This commit is contained in:
parent
48659d3b3c
commit
9bdf76f445
1 changed files with 8 additions and 9 deletions
|
@ -173,6 +173,8 @@ pub fn update_inlay_link_and_hover_points(
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
let mut go_to_definition_updated = false;
|
||||||
|
let mut hover_updated = false;
|
||||||
if let Some(hovered_offset) = hovered_offset {
|
if let Some(hovered_offset) = hovered_offset {
|
||||||
let buffer_snapshot = editor.buffer().read(cx).snapshot(cx);
|
let buffer_snapshot = editor.buffer().read(cx).snapshot(cx);
|
||||||
let previous_valid_anchor = buffer_snapshot.anchor_at(
|
let previous_valid_anchor = buffer_snapshot.anchor_at(
|
||||||
|
@ -183,9 +185,6 @@ pub fn update_inlay_link_and_hover_points(
|
||||||
point_for_position.next_valid.to_point(snapshot),
|
point_for_position.next_valid.to_point(snapshot),
|
||||||
Bias::Right,
|
Bias::Right,
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut go_to_definition_updated = false;
|
|
||||||
let mut hover_updated = false;
|
|
||||||
if let Some(hovered_hint) = editor
|
if let Some(hovered_hint) = editor
|
||||||
.visible_inlay_hints(cx)
|
.visible_inlay_hints(cx)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -324,13 +323,13 @@ pub fn update_inlay_link_and_hover_points(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if !go_to_definition_updated {
|
if !go_to_definition_updated {
|
||||||
update_go_to_definition_link(editor, None, cmd_held, shift_held, cx);
|
update_go_to_definition_link(editor, None, cmd_held, shift_held, cx);
|
||||||
}
|
}
|
||||||
if !hover_updated {
|
if !hover_updated {
|
||||||
hover_popover::hover_at(editor, None, cx);
|
hover_popover::hover_at(editor, None, cx);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue