From ce6de20db509158dd9c5b244cea3696bdb95dff3 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:39:00 +0200 Subject: [PATCH] Fix a panic when drop-splitting the terminal panel (cherry-pick #21795) (#21798) Cherry-picked Fix a panic when drop-splitting the terminal panel (#21795) Closes https://github.com/zed-industries/zed/issues/21792 Release Notes: - (Preview only) Fixed a panic when drop-splitting the terminal panel Co-authored-by: Kirill Bulatov --- crates/terminal_view/src/terminal_panel.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/terminal_view/src/terminal_panel.rs b/crates/terminal_view/src/terminal_panel.rs index 7a68fdd6baa2ef91877dc47dd03300a314579d56..ac5895d148bab299b64b02afeec01394fc937a26 100644 --- a/crates/terminal_view/src/terminal_panel.rs +++ b/crates/terminal_view/src/terminal_panel.rs @@ -912,10 +912,15 @@ pub fn new_terminal_pane( let new_pane = pane.drag_split_direction().and_then(|split_direction| { terminal_panel.update(cx, |terminal_panel, cx| { + let is_zoomed = if terminal_panel.active_pane == this_pane { + pane.is_zoomed() + } else { + terminal_panel.active_pane.read(cx).is_zoomed() + }; let new_pane = new_terminal_pane( workspace.clone(), project.clone(), - terminal_panel.active_pane.read(cx).is_zoomed(), + is_zoomed, cx, ); terminal_panel.apply_tab_bar_buttons(&new_pane, cx);