From dd5ea26cc72f3c39e9f8b4d8452a42c9c2f85442 Mon Sep 17 00:00:00 2001 From: Bartosz Zbytniewski <50180524+devzbysiu@users.noreply.github.com> Date: Sun, 18 Feb 2024 19:40:03 +0100 Subject: feat: add moving tab to other position (#3047) * feat: add moving tab to other position * docs(changelog): revert changes * test: update config snapshots * refactor: get rid of HorizontalDirection enum * refactor: cleanup code order * refactor: use debug! instead of info! * refactor: use more defensive way to switch tabs * refactor: revert tip changes * refactor: code formatting * refactor: improve invalid input notification * refactor: inline fns for calculating target index --------- Co-authored-by: Jae-Heon Ji --- zellij-server/src/route.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'zellij-server/src/route.rs') diff --git a/zellij-server/src/route.rs b/zellij-server/src/route.rs index 0dd2946ca..120f8f500 100644 --- a/zellij-server/src/route.rs +++ b/zellij-server/src/route.rs @@ -540,6 +540,16 @@ pub(crate) fn route_action( .send_to_screen(ScreenInstruction::UndoRenameTab(client_id)) .with_context(err_context)?; }, + Action::MoveTab(direction) => { + let screen_instr = match direction { + Direction::Left => ScreenInstruction::MoveTabLeft(client_id), + Direction::Right => ScreenInstruction::MoveTabRight(client_id), + _ => return Ok(false), + }; + senders + .send_to_screen(screen_instr) + .with_context(err_context)?; + }, Action::Quit => { senders .send_to_server(ServerInstruction::ClientExit(client_id)) -- cgit v1.2.3