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
+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();
}
}
}