Add space switching shortcuts

This commit is contained in:
2026-05-08 08:57:18 -04:00
parent 43ab4be548
commit cdb82bcace
7 changed files with 142 additions and 2 deletions
+1
View File
@@ -8,6 +8,7 @@ mod reading_list;
mod render;
mod sidebar;
mod site_permissions;
mod spaces;
mod splits;
mod tab_groups;
+2
View File
@@ -51,7 +51,9 @@ impl ElyShell {
.on_action(cx.listener(Self::on_open_settings))
.on_action(cx.listener(Self::on_open_task_manager))
.on_action(cx.listener(Self::on_restore_closed_tab))
.on_action(cx.listener(Self::on_select_next_space))
.on_action(cx.listener(Self::on_select_next_tab))
.on_action(cx.listener(Self::on_select_previous_space))
.on_action(cx.listener(Self::on_select_previous_tab))
.on_action(cx.listener(Self::on_split_right))
.on_action(cx.listener(Self::on_toggle_favorite_tab))
+34
View File
@@ -0,0 +1,34 @@
use gpui::{Context, Window};
use super::{ElyShell, ShellState};
use crate::{SelectNextSpace, SelectPreviousSpace};
impl ElyShell {
pub(super) fn on_select_next_space(
&mut self,
_: &SelectNextSpace,
window: &mut Window,
cx: &mut Context<Self>,
) {
if let ShellState::Ready(core) = &mut self.state
&& core.select_next_space().is_ok()
{
self.sync_address_input(window, cx);
cx.notify();
}
}
pub(super) fn on_select_previous_space(
&mut self,
_: &SelectPreviousSpace,
window: &mut Window,
cx: &mut Context<Self>,
) {
if let ShellState::Ready(core) = &mut self.state
&& core.select_previous_space().is_ok()
{
self.sync_address_input(window, cx);
cx.notify();
}
}
}