From ec3bb0f090cb1333f7406b1af44d970939357648 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Fri, 17 Nov 2023 14:11:39 -0700 Subject: [PATCH] Focus workspace on launch Fixes action dispatch when no focus is there. --- crates/zed2/src/zed2.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/zed2/src/zed2.rs b/crates/zed2/src/zed2.rs index 84cacccb5adb597b4b5fcd7650e11681b5ab7216..e7be98d45b5e18c20d8e5d357ce8db4f5480a07b 100644 --- a/crates/zed2/src/zed2.rs +++ b/crates/zed2/src/zed2.rs @@ -10,8 +10,8 @@ pub use assets::*; use collections::VecDeque; use editor::{Editor, MultiBuffer}; use gpui::{ - actions, point, px, AppContext, Context, PromptLevel, TitlebarOptions, ViewContext, - VisualContext, WindowBounds, WindowKind, WindowOptions, + actions, point, px, AppContext, Context, FocusableView, PromptLevel, TitlebarOptions, + ViewContext, VisualContext, WindowBounds, WindowKind, WindowOptions, }; pub use only_instance::*; pub use open_listener::*; @@ -425,6 +425,8 @@ pub fn initialize_workspace(app_state: Arc, cx: &mut AppContext) { } } }); + + workspace.focus_handle(cx).focus(cx); //todo!() // load_default_keymap(cx); })