Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix context in command palette from application menu (#14599)

Conrad Irwin1fe16f42ea18
diff --git a/crates/title_bar/src/application_menu.rs b/crates/title_bar/src/application_menu.rs
index 44d8f8b53ca..09ad4fe9d13 100644
--- a/crates/title_bar/src/application_menu.rs
+++ b/crates/title_bar/src/application_menu.rs
@@ -13,9 +13,10 @@ impl RenderOnce for ApplicationMenu {
fn render(self, _cx: &mut WindowContext) -> impl IntoElement {
PopoverMenu::new("application-menu")
.menu(move |cx| {
- ContextMenu::build(cx, move |menu, _cx| {
+ ContextMenu::build(cx, move |menu, cx| {
menu.header("Workspace")
.action("Open Command Palette", Box::new(command_palette::Toggle))
+ .when_some(cx.focused(), |menu, focused| menu.context(focused))
.custom_row(move |cx| {
h_flex()
.gap_2()