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
This commit is contained in:
Kirill Bulatov 2024-11-28 00:30:33 +02:00 committed by GitHub
parent e803815b16
commit 66ba9d5b4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
})
})
}