From 66ba9d5b4b27bc26571e6cb98b08cb46b7a0ae41 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 28 Nov 2024 00:30:33 +0200 Subject: [PATCH] Use item context for pane tab context menu (#21254) This allows to show proper override values for terminal tabs in Linux and Windows. Release Notes: - Fixed incorrect "close tab" keybinding shown in context menu of the terminal panel tabs on Linux and Windows --- crates/workspace/src/pane.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index 292f59eba8e814f3a27c288f72fc97650bb76248..dc7b92a13ba3744586c158183e9728d05901e95d 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -2075,8 +2075,10 @@ impl Pane { let is_pinned = self.is_tab_pinned(ix); let pane = cx.view().downgrade(); + let menu_context = item.focus_handle(cx); right_click_menu(ix).trigger(tab).menu(move |cx| { let pane = pane.clone(); + let menu_context = menu_context.clone(); ContextMenu::build(cx, move |mut menu, cx| { if let Some(pane) = pane.upgrade() { menu = menu @@ -2255,7 +2257,7 @@ impl Pane { } } - menu + menu.context(menu_context) }) }) }