From c4dac3c6b1651158337f46d22ff15ee3010b38a3 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 7 Sep 2021 15:00:24 +0200 Subject: [PATCH] Open a window with an empty buffer when launching zed with no args --- zed/src/main.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/zed/src/main.rs b/zed/src/main.rs index 5ad05738e6..a7dc346e36 100644 --- a/zed/src/main.rs +++ b/zed/src/main.rs @@ -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 })); } }); }