From ed31d36ac1013c06d07e142092b9618cbc7fbf4a Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Tue, 5 Dec 2023 20:24:01 -0500 Subject: [PATCH] Wire up `NewWindow` action --- crates/editor2/src/editor.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/editor2/src/editor.rs b/crates/editor2/src/editor.rs index 4b14ec42f1ed11b73220b4e785c4ceb1ad7cae45..3fdccb2de42f578c1a9857a9b25403119f617e00 100644 --- a/crates/editor2/src/editor.rs +++ b/crates/editor2/src/editor.rs @@ -431,6 +431,15 @@ pub fn init(cx: &mut AppContext) { .detach(); } }); + cx.on_action(move |_: &workspace::NewWindow, cx| { + let app_state = cx.global::>(); + if let Some(app_state) = app_state.upgrade() { + workspace::open_new(&app_state, cx, |workspace, cx| { + Editor::new_file(workspace, &Default::default(), cx) + }) + .detach(); + } + }) } trait InvalidationRegion {