From 31e47f9b525f316fb862684df42e952eb6a91e84 Mon Sep 17 00:00:00 2001 From: Julia Date: Thu, 21 Dec 2023 12:56:30 -0500 Subject: [PATCH] Prevent panic dragging tab into terminal panel --- crates/workspace2/src/pane.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/workspace2/src/pane.rs b/crates/workspace2/src/pane.rs index 4d20699528e453718b5afdc142cb7e87047c9fb9..7b9ac4ab13652ec2e9377027086aebdfc206cd14 100644 --- a/crates/workspace2/src/pane.rs +++ b/crates/workspace2/src/pane.rs @@ -1754,6 +1754,10 @@ impl Pane { } fn handle_drag_move(&mut self, event: &DragMoveEvent, cx: &mut ViewContext) { + 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(); } }