diff options
author | Henil Dedania <dedaniahenil@gmail.com> | 2021-11-05 13:59:45 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-05 09:29:45 +0100 |
commit | 4ac9344085a6a59e78608954cf89955f4e9ddb61 (patch) | |
tree | 2fe9fb7697ec92437af19ce77627c374f5db35ec /zellij-server/src/route.rs | |
parent | 3e052519f90b39e86f581fd0b8cabc0049736211 (diff) |
feature(resize): Non directional resize (#520)
* feature(resize): Non directional resize
* Implement special cases
* fix resizing for panes that have `+` cross section
* fix resizing for panes that have `T` cross section
* fix panics
* Add Nondirection resize keys to plugin
* fix formatting
* fix: clippy warnings
* fix the last edge case
* implemented some of the suggested changes
* Remove helper function and elevate comment to top of function
* Use `=` to keep it consistent with Normal mode mapping as its easier to use
* Remove extra reference borrowing
* fix an edge case
* add test for nondirectional resize increase/decrease
* fix(controls): add + to resize
* refactor(resize): simplify methods
* fix(resize): properly resize opposite corner pane
Co-authored-by: Aram Drevekenin <aram@poor.dev>
Diffstat (limited to 'zellij-server/src/route.rs')
-rw-r--r-- | zellij-server/src/route.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/zellij-server/src/route.rs b/zellij-server/src/route.rs index 57fea1247..444be5a08 100644 --- a/zellij-server/src/route.rs +++ b/zellij-server/src/route.rs @@ -12,7 +12,7 @@ use crate::{ use zellij_utils::{ channels::SenderWithContext, input::{ - actions::{Action, Direction}, + actions::{Action, Direction, ResizeDirection}, command::TerminalAction, get_mode_info, }, @@ -87,10 +87,12 @@ fn route_action( } Action::Resize(direction) => { let screen_instr = match direction { - Direction::Left => ScreenInstruction::ResizeLeft(client_id), - Direction::Right => ScreenInstruction::ResizeRight(client_id), - Direction::Up => ScreenInstruction::ResizeUp(client_id), - Direction::Down => ScreenInstruction::ResizeDown(client_id), + ResizeDirection::Left => ScreenInstruction::ResizeLeft(client_id), + ResizeDirection::Right => ScreenInstruction::ResizeRight(client_id), + ResizeDirection::Up => ScreenInstruction::ResizeUp(client_id), + ResizeDirection::Down => ScreenInstruction::ResizeDown(client_id), + ResizeDirection::Increase => ScreenInstruction::ResizeIncrease(client_id), + ResizeDirection::Decrease => ScreenInstruction::ResizeDecrease(client_id), }; session.senders.send_to_screen(screen_instr).unwrap(); } |