From 70918609d854a576ffd285b4c0b0d2d8613c997a Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Mon, 25 Aug 2025 10:41:34 -0400 Subject: [PATCH] Fix has_pending_selection logic for inlay hovers Co-authored-by: David Kleingeld --- crates/editor/src/hover_links.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/hover_links.rs b/crates/editor/src/hover_links.rs index 15366f49b3..78bd1ac775 100644 --- a/crates/editor/src/hover_links.rs +++ b/crates/editor/src/hover_links.rs @@ -124,9 +124,20 @@ impl Editor { ) { let hovered_link_modifier = Editor::multi_cursor_modifier(false, &modifiers, cx); + // When you're dragging to select, and you release the drag to create the selection, + // if you happened to end over something hoverable (including an inlay hint), don't + // have the hovered link appear. That would be annoying, because all you're trying + // to do is to create a selection, not hover to see a hovered link. + if self.has_pending_selection() { + self.hide_hovered_link(cx); + return; + } + match point_for_position.as_valid() { Some(point) => { - if !hovered_link_modifier || self.has_pending_selection() { + // Hide the underline unless you're holding the modifier key on the keyboard + // which will perform a goto definition. + if !hovered_link_modifier { self.hide_hovered_link(cx); return; }