Open a window with an empty buffer when launching zed with no args

This commit is contained in:
Antonio Scandurra 2021-09-07 15:00:24 +02:00
parent 058691d2b2
commit c4dac3c6b1

View file

@ -15,7 +15,7 @@ use zed::{
fs::RealFs,
language, menus, rpc, settings, theme_selector,
user::UserStore,
workspace::{self, OpenParams, OpenPaths},
workspace::{self, OpenNew, OpenParams, OpenPaths},
AppState,
};
@ -62,11 +62,10 @@ fn main() {
}
let paths = collect_path_args();
if !paths.is_empty() {
cx.dispatch_global_action(OpenPaths(OpenParams {
paths,
app_state: app_state.clone(),
}));
if paths.is_empty() {
cx.dispatch_global_action(OpenNew(app_state));
} else {
cx.dispatch_global_action(OpenPaths(OpenParams { paths, app_state }));
}
});
}