Set up menu handler in App::new
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
co-authored by
Nathan Sobo
parent
2332b7e06b
commit
41358f34e3
+2
-9
@@ -1,12 +1,9 @@
|
||||
use fs::OpenOptions;
|
||||
use gpui::PathPromptOptions;
|
||||
use log::LevelFilter;
|
||||
use simplelog::SimpleLogger;
|
||||
use std::{fs, path::PathBuf};
|
||||
use zed::{
|
||||
assets, editor, file_finder, menus,
|
||||
settings::{self, Settings},
|
||||
watch::Receiver,
|
||||
assets, editor, file_finder, menus, settings,
|
||||
workspace::{self, OpenParams},
|
||||
};
|
||||
|
||||
@@ -16,11 +13,7 @@ fn main() {
|
||||
let app = gpui::App::new(assets::Assets).unwrap();
|
||||
let (_, settings_rx) = settings::channel(&app.font_cache()).unwrap();
|
||||
app.set_menus(menus::menus(settings_rx.clone()));
|
||||
app.on_menu_command(move |command, arg, ctx| {
|
||||
eprintln!("command: {:?} {:?}", command, arg);
|
||||
ctx.dispatch_global_action_with_dyn_arg(command, arg.unwrap_or(&()))
|
||||
})
|
||||
.run(move |ctx| {
|
||||
app.run(move |ctx| {
|
||||
workspace::init(ctx);
|
||||
editor::init(ctx);
|
||||
file_finder::init(ctx);
|
||||
|
||||
Reference in New Issue
Block a user