From 25489c2b7a5a5dbcb53a33da19662a9b9c9810d8 Mon Sep 17 00:00:00 2001 From: dDostalker <146743193+dDostalker@users.noreply.github.com> Date: Tue, 11 Nov 2025 20:22:32 +0800 Subject: [PATCH] Fix adding a Python virtual environment, may duplicate the "open this dictionary" string when modifying content. (#41840) Release Notes: - Fixed an issue when adding a Python virtual environment that may cause duplicate "open this dictionary" entries - Trigger condition: Type `C:\`, delete `\`, then repeatedly add `\`. -Video bug: https://github.com/user-attachments/assets/f68008bb-9138-4451-a842-25b58574493b fix: https://github.com/user-attachments/assets/2913b8c2-adee-4275-af7e-e055fd78915f --- crates/file_finder/src/open_path_prompt.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/file_finder/src/open_path_prompt.rs b/crates/file_finder/src/open_path_prompt.rs index f29c0e6cd20f423dd9073abced0182f272b588c9..53bad3b34880d69aba169df965db71f69b2296eb 100644 --- a/crates/file_finder/src/open_path_prompt.rs +++ b/crates/file_finder/src/open_path_prompt.rs @@ -399,7 +399,12 @@ impl PickerDelegate for OpenPathDelegate { } }) .unwrap_or(false); - if should_prepend_with_current_dir { + + let current_dir_in_new_entries = new_entries + .iter() + .any(|entry| &entry.path.string == current_dir); + + if should_prepend_with_current_dir && !current_dir_in_new_entries { new_entries.insert( 0, CandidateInfo {