From dc40f2155f91f084ffa33667a6f6292b92958807 Mon Sep 17 00:00:00 2001 From: David Budke Date: Tue, 6 Jan 2026 09:04:17 -0600 Subject: [PATCH] editor: Fix ctrl+drag/drop to duplicate selected text (#45611) Holding control while dragging text to copy it was being blocked by link handling stopping the propogation of the mouse event; solution: don't handle link clicks when selection_drag_state is Dragging. Issue found & fix tested on Linux (since the modifier key on mac is apparently different, the issue likely doesn't occur there, but I'm assuming it does apply to Windows). I didn't see an issue open for it, and since I fixed it myself I'm unsure whether it needs one or if the PR is enough. Release Notes: - Fix an issue where Ctrl+drag to duplicate selected text on Linux and Windows when the selection is inside a link. --- crates/editor/src/element.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 2c3eb5b996f254a3734cfd95742e3f63a11c027f..da6bfbc176a9fedc4e80fef14e164102382a00d5 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -1022,6 +1022,10 @@ impl EditorElement { && hovered_link_modifier && mouse_down_hovered_link_modifier && text_hitbox.is_hovered(window) + && !matches!( + editor.selection_drag_state, + SelectionDragState::Dragging { .. } + ) { let point = position_map.point_for_position(mouse_position); editor.handle_click_hovered_link(point, event.modifiers(), window, cx);