editor: Fix sometimes green (+) cursor style appearing when cmd-clicking in same buffer (#34638)

Follow-up for https://github.com/zed-industries/zed/pull/34557

This PR clears the selection drag state on click, because mouse up
doesn't trigger on click event because of `cx.stop_propagation`. The
issue occurs with similar repro steps as mentioned in the attached PR.

Release Notes:

- Fixed the issue where the green (+) cursor style sometimes appears
when navigating to the definition in buffer.
This commit is contained in:
Smit Barmase 2025-07-17 22:46:44 +05:30 committed by GitHub
parent 1ceda2babd
commit 0f72d7ed52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -949,6 +949,7 @@ impl EditorElement {
if !pending_nonempty_selections && hovered_link_modifier && text_hitbox.is_hovered(window) {
let point = position_map.point_for_position(event.up.position);
editor.handle_click_hovered_link(point, event.modifiers(), window, cx);
editor.selection_drag_state = SelectionDragState::None;
cx.stop_propagation();
}