From 43e2c92910c034c0bff0a8d2212b2916b80fa2dd Mon Sep 17 00:00:00 2001 From: Smit Barmase Date: Wed, 16 Jul 2025 23:24:02 +0530 Subject: [PATCH] editor: Fix sometimes green (+) cursor style appearing when cmd-clicking to navigate and back (#34557) Regressed in https://github.com/zed-industries/zed/pull/33928 This PR clears the selection drag state when the editor focus is out. To reproduce: 1. Select some item in buffer that has a go to definition. 2. Cmd+Click mouse down on it, but don't let go. 3. Wait for 300ms+. 4. Now cursor changed to green + (valid state, this is for selection drag-n-drop). 5. Now let go of your mouse down, we switched to a different file. Cursor looks normal. 6. Come back to the previous buffer, see green + cursor style (BUG!). Release Notes: - Fixed the issue where the green (+) cursor style sometimes appears when navigating to the definition and then back to the previous buffer. --- crates/editor/src/editor.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 263544dba6..0d905c99dc 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -20467,6 +20467,7 @@ impl Editor { if event.blurred != self.focus_handle { self.last_focused_descendant = Some(event.blurred); } + self.selection_drag_state = SelectionDragState::None; self.refresh_inlay_hints(InlayHintRefreshReason::ModifiersChanged(false), cx); }