Fix error when running workspace:open command

This commit is contained in:
Max Brunsfeld 2021-05-28 16:34:28 -07:00
parent ff2ab4b72d
commit f87aa14ebf
2 changed files with 4 additions and 5 deletions

View file

@ -25,7 +25,7 @@ fn main() {
};
app.run(move |cx| {
cx.set_menus(menus::menus(app_state.settings.clone()));
cx.set_menus(menus::menus(app_state.clone()));
workspace::init(cx);
editor::init(cx);
file_finder::init(cx);

View file

@ -1,9 +1,8 @@
use crate::settings::Settings;
use crate::AppState;
use gpui::{Menu, MenuItem};
use postage::watch;
#[cfg(target_os = "macos")]
pub fn menus(settings: watch::Receiver<Settings>) -> Vec<Menu<'static>> {
pub fn menus(state: AppState) -> Vec<Menu<'static>> {
vec![
Menu {
name: "Zed",
@ -37,7 +36,7 @@ pub fn menus(settings: watch::Receiver<Settings>) -> Vec<Menu<'static>> {
name: "Open…",
keystroke: Some("cmd-o"),
action: "workspace:open",
arg: Some(Box::new(settings)),
arg: Some(Box::new(state)),
},
],
},