@@ -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<Self>,
- ) {
+ fn cycle_project_impl(&mut self, forward: bool, window: &mut Window, cx: &mut Context<Self>) {
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<Self>,
- ) {
+ fn on_next_project(&mut self, _: &NextProject, window: &mut Window, cx: &mut Context<Self>) {
self.cycle_project_impl(true, window, cx);
}
@@ -130,13 +130,7 @@ pub trait Sidebar: Focusable + Render + EventEmitter<SidebarEvent> + Sized {
}
/// Activates the next or previous project group.
- fn cycle_project(
- &mut self,
- _forward: bool,
- _window: &mut Window,
- _cx: &mut Context<Self>,
- ) {
- }
+ fn cycle_project(&mut self, _forward: bool, _window: &mut Window, _cx: &mut Context<Self>) {}
/// Activates the next or previous thread in sidebar order.
fn cycle_thread(&mut self, _forward: bool, _window: &mut Window, _cx: &mut Context<Self>) {}
@@ -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);