From 40a8c26080575a59190611567722cab9c8168953 Mon Sep 17 00:00:00 2001 From: ForLoveOfCats Date: Fri, 19 Aug 2022 17:25:35 -0400 Subject: [PATCH] Include empty selections in updating link logic on cmd/shift changed Prevents an issue where pressing cmd while the mouse button is down would create a link which would fire on mouse up if the selection was still empty --- crates/editor/src/link_go_to_definition.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/editor/src/link_go_to_definition.rs b/crates/editor/src/link_go_to_definition.rs index 6af985171a87cd9d678d46a8fc7504b93199ba54..6b23a04b67997844194f2cec9aff5ee3fdb87728 100644 --- a/crates/editor/src/link_go_to_definition.rs +++ b/crates/editor/src/link_go_to_definition.rs @@ -121,14 +121,14 @@ pub fn cmd_shift_changed( }: &CmdShiftChanged, cx: &mut ViewContext, ) { - let pending_nonempty_selection = editor.has_pending_nonempty_selection(); + let pending_selection = editor.has_pending_selection(); if let Some(point) = editor .link_go_to_definition_state .last_mouse_location .clone() { - if cmd_down && !pending_nonempty_selection { + if cmd_down && !pending_selection { let snapshot = editor.snapshot(cx); let kind = if shift_down { LinkDefinitionKind::Type