Use proper terminal item for splitting context (#21415)

Kirill Bulatov created

Closes https://github.com/zed-industries/zed/issues/21411

Release Notes:

- N/A

Change summary

crates/terminal_view/src/terminal_panel.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Detailed changes

crates/terminal_view/src/terminal_panel.rs 🔗

@@ -131,8 +131,8 @@ impl TerminalPanel {
         terminal_pane.update(cx, |pane, cx| {
             pane.set_render_tab_bar_buttons(cx, move |pane, cx| {
                 let split_context = pane
-                    .items()
-                    .find_map(|item| item.downcast::<TerminalView>())
+                    .active_item()
+                    .and_then(|item| item.downcast::<TerminalView>())
                     .map(|terminal_view| terminal_view.read(cx).focus_handle.clone());
                 if !pane.has_focus(cx) && !pane.context_menu_focused(cx) {
                     return (None, None);