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.

Prevent panic dragging tab into terminal panel

Julia31e47f9b525f
diff --git a/crates/workspace2/src/pane.rs b/crates/workspace2/src/pane.rs
index 4d20699528e..7b9ac4ab136 100644
--- a/crates/workspace2/src/pane.rs
+++ b/crates/workspace2/src/pane.rs
@@ -1754,6 +1754,10 @@ impl Pane {
}
fn handle_drag_move<T>(&mut self, event: &DragMoveEvent<T>, cx: &mut ViewContext<Self>) {
+ if !self.can_split {
+ return;
+ }
+
let edge_width = cx.rem_size() * 8;
let cursor = event.event.position;
let direction = if cursor.x < event.bounds.left() + edge_width {
@@ -1767,9 +1771,9 @@ impl Pane {
} else {
None
};
+
if direction != self.drag_split_direction {
self.drag_split_direction = direction;
- cx.notify();
}
}