Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix folder expand when dropped on itself in project_panel (#20365)

Mathiasf924c3ef00fc
diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs
index d17c668ee08..4892a210686 100644
--- a/crates/project_panel/src/project_panel.rs
+++ b/crates/project_panel/src/project_panel.rs
@@ -1703,6 +1703,10 @@ impl ProjectPanel {
destination_is_file: bool,
cx: &mut ViewContext<Self>,
) {
+ if entry_to_move == destination {
+ return;
+ }
+
let destination_worktree = self.project.update(cx, |project, cx| {
let entry_path = project.path_for_entry(entry_to_move, cx)?;
let destination_entry_path = project.path_for_entry(destination, cx)?.path.clone();