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.

Clone item when dragging to split

Max Brunsfeld4f32f662711a
diff --git a/crates/workspace2/src/pane.rs b/crates/workspace2/src/pane.rs
index 275f78dd9f2..a55469fbadd 100644
--- a/crates/workspace2/src/pane.rs
+++ b/crates/workspace2/src/pane.rs
@@ -1777,10 +1777,11 @@ impl Pane {
.read(cx)
.items()
.find(|item| item.item_id() == item_id)
- .map(|i| i.boxed_clone());
-
+ .map(|item| item.boxed_clone());
if let Some(item) = item {
- workspace.split_item(split_direction, item, cx);
+ if let Some(item) = item.clone_on_split(workspace.database_id(), cx) {
+ workspace.split_item(split_direction, item, cx);
+ }
}
});
})