diff --git a/crates/sidebar/src/sidebar.rs b/crates/sidebar/src/sidebar.rs index fe1f97112c2e2f8231971da3aae24e0c73eab710..2a751f65fa085403635abfd23e878a5984d7b1af 100644 --- a/crates/sidebar/src/sidebar.rs +++ b/crates/sidebar/src/sidebar.rs @@ -3084,12 +3084,7 @@ impl Sidebar { Some(mw.workspace().read(cx).project_group_key(cx)) } - fn cycle_project_impl( - &mut self, - forward: bool, - window: &mut Window, - cx: &mut Context, - ) { + fn cycle_project_impl(&mut self, forward: bool, window: &mut Window, cx: &mut Context) { let Some(multi_workspace) = self.multi_workspace.upgrade() else { return; }; @@ -3134,12 +3129,7 @@ impl Sidebar { } } - fn on_next_project( - &mut self, - _: &NextProject, - window: &mut Window, - cx: &mut Context, - ) { + fn on_next_project(&mut self, _: &NextProject, window: &mut Window, cx: &mut Context) { self.cycle_project_impl(true, window, cx); } diff --git a/crates/workspace/src/multi_workspace.rs b/crates/workspace/src/multi_workspace.rs index 19699bcd9743ffb5098636e4b2091c30e1091574..28be17faf554948f0e9c37998392636656b58f5c 100644 --- a/crates/workspace/src/multi_workspace.rs +++ b/crates/workspace/src/multi_workspace.rs @@ -130,13 +130,7 @@ pub trait Sidebar: Focusable + Render + EventEmitter + Sized { } /// Activates the next or previous project group. - fn cycle_project( - &mut self, - _forward: bool, - _window: &mut Window, - _cx: &mut Context, - ) { - } + fn cycle_project(&mut self, _forward: bool, _window: &mut Window, _cx: &mut Context) {} /// Activates the next or previous thread in sidebar order. fn cycle_thread(&mut self, _forward: bool, _window: &mut Window, _cx: &mut Context) {} @@ -1513,20 +1507,18 @@ impl Render for MultiWorkspace { } }, )) + .on_action(cx.listener(|this: &mut Self, _: &NextProject, window, cx| { + if let Some(sidebar) = &this.sidebar { + sidebar.cycle_project(true, window, cx); + } + })) .on_action( - cx.listener(|this: &mut Self, _: &NextProject, window, cx| { - if let Some(sidebar) = &this.sidebar { - sidebar.cycle_project(true, window, cx); - } - }, - )) - .on_action(cx.listener( - |this: &mut Self, _: &PreviousProject, window, cx| { + cx.listener(|this: &mut Self, _: &PreviousProject, window, cx| { if let Some(sidebar) = &this.sidebar { sidebar.cycle_project(false, window, cx); } - }, - )) + }), + ) .on_action(cx.listener(|this: &mut Self, _: &NextThread, window, cx| { if let Some(sidebar) = &this.sidebar { sidebar.cycle_thread(true, window, cx);