From cfcfc3bf6b1493e7668ed6a0c433f198690d6358 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 6 Jun 2023 09:03:57 -0700 Subject: [PATCH] Show notification when attempting to open local settings in a project w/ no folders --- crates/zed/src/zed.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index f0e88133f3..8d27a378c5 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -44,8 +44,9 @@ use uuid::Uuid; use welcome::BaseKeymap; pub use workspace; use workspace::{ - create_and_open_local_file, dock::PanelHandle, open_new, AppState, NewFile, NewWindow, - Workspace, WorkspaceSettings, + create_and_open_local_file, dock::PanelHandle, + notifications::simple_message_notification::MessageNotification, open_new, AppState, NewFile, + NewWindow, Workspace, WorkspaceSettings, }; #[derive(Deserialize, Clone, PartialEq)] @@ -626,6 +627,10 @@ fn open_local_settings_file( anyhow::Ok(()) }) .detach(); + } else { + workspace.show_notification(0, cx, |cx| { + cx.add_view(|_| MessageNotification::new("This project has no folders open.")) + }) } }