diff options
| author | har7an <99636919+har7an@users.noreply.github.com> | 2022-12-08 12:50:28 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-08 12:50:28 +0000 |
| commit | 62eaea15833b34f40270dc1ce8f6d57639dc4bdd (patch) | |
| tree | eb06c1f3075ccb5ed6f536d427e14c4fdbdef4e2 /zellij-server/src/tab/unit | |
| parent | docs(changelog): loading screen (diff) | |
| download | sl0ppij-62eaea15833b34f40270dc1ce8f6d57639dc4bdd.tar.gz sl0ppij-62eaea15833b34f40270dc1ce8f6d57639dc4bdd.tar.xz sl0ppij-62eaea15833b34f40270dc1ce8f6d57639dc4bdd.zip | |
Reimplement resize code (#1990)
* server/floating_panes: Start removing `unwrap`s
* server/panes: Remove more `unwrap`s
in floating panes code.
* utils/data: Unify `Direction` type
which was previously present in multiple locations.
Also start working on a new Resize Method (type `ResizeStrategy`), to
remove code duplication in the resize code.
* server: Implement new resize handling
with the `ResizeStrategy` type. Add a new action with the ability to
invoke it from the CLI. Take care to maintain backwards-compatibility in
terms of configuring the new resize mode.
* utils/layout: Add conversion for SplitDirection
from `data::Direction`.
* utils/data: Add impl for `Direction`
* server/panes: Rework tiled pane resizing
but it's currently still broken in a few regards and misses ability to
perform "regular" increase/decrease.
* server/panes/tiled_panes: Add debug assertion
to catch if the total area of all panes (in percent) is different from
100.0 at some point.
* server/panes/tiled/grid: Fix resize bug
caused by the fact that neighboring plugin panes previously weren't
filtered from resize operations, even though they cannot be resized at
all.
* utils/data: Add `invert` for `Resize`
* utils/data: Add member to `ResizeStrategy`
that controls whether we invert resize behavior when increasing size
towards a bounadry. This maintains current behavior.
* server/screen: Handle new attribute
in `ResizeStrategy`
* server/panes/resizer: Return `anyhow::Error`
* server/panes/tiled: Implement resize increase/decrease
without specifying a direction (towards all possible directions).
Currently broken in some cases.
* server/pane/tiled/grid: Don't return early
to preserve resize debug assertions.
* server/pane/tiled/grid: Fix resize bug
caused by checking for the wrong alignments in some cases. Also refactor
the code for looking up aligned panes.
* server/panes/tiled/grid: Cleanup code
and remove log statements and unused functions.
* server/panes/float/grid: Invert resize
if the floating pane is hitting a boundary already.
* plugins/status-bar: Add hints for new resize
* server: Use new resize method
* server: Fix tests
with new functions and result types.
* apply rustfmt
* utils: Apply rustfmt
* server/panes/floating: Fix resize increase
behavior which would previously, upon hitting a boundary, cause the pane
to invert the resize operation, which is wrong. Instead, it now does not
resize floating panes on an undirected resize "increase" in directions
where it hits boundaries.
* server/panes/tiled: Use correct resize increments
The values for the resize increments were previously wrong, causing many
of the tests to fail.
* server/panes/tiled: Fix resize checks
to correctly consider fixed-size panes.
* utils/assets/config: Update default config
with new keybindings for resize mode.
* server/panes/tiled: Fix resize check
* server/panes/tiled: Use shortener for `Direction`
type in `change_pane_size` function.
* server/panes/tiled: Restore resize behavior
for undirected resizes, to the way it was before this PR.
* server/panes/floating: Fix resize increment
for undirected resizes
* utils/data: Fix doctest
* utils: Fix test snapshots
for tests working with the default config
* changelog: Add PR #1990
Diffstat (limited to 'zellij-server/src/tab/unit')
| -rw-r--r-- | zellij-server/src/tab/unit/tab_integration_tests.rs | 33 | ||||
| -rw-r--r-- | zellij-server/src/tab/unit/tab_tests.rs | 178 |
2 files changed, 135 insertions, 76 deletions
diff --git a/zellij-server/src/tab/unit/tab_integration_tests.rs b/zellij-server/src/tab/unit/tab_integration_tests.rs index c635b125..81be51cc 100644 --- a/zellij-server/src/tab/unit/tab_integration_tests.rs +++ b/zellij-server/src/tab/unit/tab_integration_tests.rs @@ -11,6 +11,9 @@ use crate::{ }; use std::path::PathBuf; use zellij_utils::channels::Receiver; +use zellij_utils::data::Direction; +use zellij_utils::data::Resize; +use zellij_utils::data::ResizeStrategy; use zellij_utils::envs::set_session_name; use zellij_utils::errors::{prelude::*, ErrorContext}; use zellij_utils::input::layout::{Layout, PaneLayout}; @@ -765,7 +768,8 @@ fn increase_floating_pane_size() { Vec::from("\n\n\n I am scratch terminal".as_bytes()), ) .unwrap(); - tab.resize_increase(client_id); + tab.resize(client_id, ResizeStrategy::new(Resize::Increase, None)) + .unwrap(); tab.render(&mut output, None).unwrap(); let snapshot = take_snapshot( output.serialize().unwrap().get(&client_id).unwrap(), @@ -794,7 +798,8 @@ fn decrease_floating_pane_size() { Vec::from("\n\n\n I am scratch terminal".as_bytes()), ) .unwrap(); - tab.resize_decrease(client_id); + tab.resize(client_id, ResizeStrategy::new(Resize::Decrease, None)) + .unwrap(); tab.render(&mut output, None).unwrap(); let snapshot = take_snapshot( output.serialize().unwrap().get(&client_id).unwrap(), @@ -823,7 +828,11 @@ fn resize_floating_pane_left() { Vec::from("\n\n\n I am scratch terminal".as_bytes()), ) .unwrap(); - tab.resize_left(client_id); + tab.resize( + client_id, + ResizeStrategy::new(Resize::Increase, Some(Direction::Left)), + ) + .unwrap(); tab.render(&mut output, None).unwrap(); let snapshot = take_snapshot( output.serialize().unwrap().get(&client_id).unwrap(), @@ -852,7 +861,11 @@ fn resize_floating_pane_right() { Vec::from("\n\n\n I am scratch terminal".as_bytes()), ) .unwrap(); - tab.resize_right(client_id); + tab.resize( + client_id, + ResizeStrategy::new(Resize::Increase, Some(Direction::Right)), + ) + .unwrap(); tab.render(&mut output, None).unwrap(); let snapshot = take_snapshot( output.serialize().unwrap().get(&client_id).unwrap(), @@ -881,7 +894,11 @@ fn resize_floating_pane_up() { Vec::from("\n\n\n I am scratch terminal".as_bytes()), ) .unwrap(); - tab.resize_up(client_id); + tab.resize( + client_id, + ResizeStrategy::new(Resize::Increase, Some(Direction::Up)), + ) + .unwrap(); tab.render(&mut output, None).unwrap(); let snapshot = take_snapshot( output.serialize().unwrap().get(&client_id).unwrap(), @@ -910,7 +927,11 @@ fn resize_floating_pane_down() { Vec::from("\n\n\n I am scratch terminal".as_bytes()), ) .unwrap(); - tab.resize_down(client_id); + tab.resize( + client_id, + ResizeStrategy::new(Resize::Increase, Some(Direction::Down)), + ) + .unwrap(); tab.render(&mut output, None).unwrap(); let snapshot = take_snapshot( output.serialize().unwrap().get(&client_id).unwrap(), diff --git a/zellij-server/src/tab/unit/tab_tests.rs b/zellij-server/src/tab/unit/tab_tests.rs index 4ddd0fda..a676f3c6 100644 --- a/zellij-server/src/tab/unit/tab_tests.rs +++ b/zellij-server/src/tab/unit/tab_tests.rs @@ -8,6 +8,7 @@ use crate::{ ClientId, }; use std::path::PathBuf; +use zellij_utils::data::{Direction, Resize, ResizeStrategy}; use zellij_utils::errors::prelude::*; use zellij_utils::input::layout::PaneLayout; use zellij_utils::ipc::IpcReceiverWithContext; @@ -98,6 +99,43 @@ impl ServerOsApi for FakeInputOutput { } } +fn tab_resize_increase(tab: &mut Tab, id: ClientId) { + tab.resize(id, ResizeStrategy::new(Resize::Increase, None)) + .unwrap(); +} + +fn tab_resize_left(tab: &mut Tab, id: ClientId) { + tab.resize( + id, + ResizeStrategy::new(Resize::Increase, Some(Direction::Left)), + ) + .unwrap(); +} + +fn tab_resize_down(tab: &mut Tab, id: ClientId) { + tab.resize( + id, + ResizeStrategy::new(Resize::Increase, Some(Direction::Down)), + ) + .unwrap(); +} + +fn tab_resize_up(tab: &mut Tab, id: ClientId) { + tab.resize( + id, + ResizeStrategy::new(Resize::Increase, Some(Direction::Up)), + ) + .unwrap(); +} + +fn tab_resize_right(tab: &mut Tab, id: ClientId) { + tab.resize( + id, + ResizeStrategy::new(Resize::Increase, Some(Direction::Right)), + ) + .unwrap(); +} + fn create_new_tab(size: Size) -> Tab { let index = 0; let position = 0; @@ -1521,7 +1559,7 @@ pub fn close_pane_with_multiple_panes_above_it_away_from_screen_edges() { tab.horizontal_split(new_pane_id_5, None, 1).unwrap(); tab.move_focus_left(1); tab.move_focus_up(1); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); tab.vertical_split(new_pane_id_6, None, 1).unwrap(); tab.move_focus_down(1); tab.close_focused_pane(1).unwrap(); @@ -1820,7 +1858,7 @@ pub fn close_pane_with_multiple_panes_below_it_away_from_screen_edges() { tab.move_focus_right(1); tab.horizontal_split(new_pane_id_5, None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); tab.vertical_split(new_pane_id_6, None, 1).unwrap(); tab.move_focus_up(1); tab.close_focused_pane(1).unwrap(); @@ -2122,9 +2160,9 @@ pub fn close_pane_with_multiple_panes_to_the_left_away_from_screen_edges() { tab.vertical_split(new_pane_id_5, None, 1).unwrap(); tab.move_focus_up(1); tab.move_focus_left(1); - tab.resize_right(1); - tab.resize_up(1); - tab.resize_up(1); + tab_resize_right(&mut tab, 1); + tab_resize_up(&mut tab, 1); + tab_resize_up(&mut tab, 1); tab.horizontal_split(new_pane_id_6, None, 1).unwrap(); tab.move_focus_right(1); tab.close_focused_pane(1).unwrap(); @@ -2425,9 +2463,9 @@ pub fn close_pane_with_multiple_panes_to_the_right_away_from_screen_edges() { tab.move_focus_down(1); tab.vertical_split(new_pane_id_5, None, 1).unwrap(); tab.move_focus_up(1); - tab.resize_left(1); - tab.resize_up(1); - tab.resize_up(1); + tab_resize_left(&mut tab, 1); + tab_resize_up(&mut tab, 1); + tab_resize_up(&mut tab, 1); tab.horizontal_split(new_pane_id_6, None, 1).unwrap(); tab.move_focus_left(1); tab.close_focused_pane(1).unwrap(); @@ -3145,7 +3183,7 @@ pub fn resize_down_with_pane_above() { let mut tab = create_new_tab(size); let new_pane_id = PaneId::Terminal(2); tab.horizontal_split(new_pane_id, None, 1).unwrap(); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -3252,7 +3290,7 @@ pub fn resize_down_with_pane_below() { let new_pane_id = PaneId::Terminal(2); tab.horizontal_split(new_pane_id, None, 1).unwrap(); tab.move_focus_up(1); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -3366,7 +3404,7 @@ pub fn resize_down_with_panes_above_and_below() { tab.horizontal_split(new_pane_id_1, None, 1).unwrap(); tab.horizontal_split(new_pane_id_2, None, 1).unwrap(); tab.move_focus_up(1); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -3520,7 +3558,7 @@ pub fn resize_down_with_multiple_panes_above() { tab.move_focus_up(1); tab.vertical_split(new_pane_id_2, None, 1).unwrap(); tab.move_focus_down(1); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -3676,7 +3714,7 @@ pub fn resize_down_with_panes_above_aligned_left_with_current_pane() { tab.move_focus_up(1); tab.vertical_split(pane_above, None, 1).unwrap(); tab.move_focus_down(1); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -3875,7 +3913,7 @@ pub fn resize_down_with_panes_below_aligned_left_with_current_pane() { tab.vertical_split(pane_below, None, 1).unwrap(); tab.move_focus_up(1); tab.vertical_split(focused_pane, None, 1).unwrap(); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -4076,7 +4114,7 @@ pub fn resize_down_with_panes_above_aligned_right_with_current_pane() { tab.vertical_split(pane_above_and_right, None, 1).unwrap(); tab.move_focus_down(1); tab.move_focus_left(1); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -4276,7 +4314,7 @@ pub fn resize_down_with_panes_below_aligned_right_with_current_pane() { tab.move_focus_up(1); tab.vertical_split(pane_to_the_right, None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -4475,7 +4513,7 @@ pub fn resize_down_with_panes_above_aligned_left_and_right_with_current_pane() { tab.vertical_split(PaneId::Terminal(6), None, 1).unwrap(); tab.move_focus_left(1); tab.move_focus_down(1); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -4759,7 +4797,7 @@ pub fn resize_down_with_panes_below_aligned_left_and_right_with_current_pane() { tab.vertical_split(PaneId::Terminal(5), None, 1).unwrap(); tab.vertical_split(PaneId::Terminal(6), None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -5047,7 +5085,7 @@ pub fn resize_down_with_panes_above_aligned_left_and_right_with_panes_to_the_lef tab.vertical_split(PaneId::Terminal(7), None, 1).unwrap(); tab.vertical_split(PaneId::Terminal(8), None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -5423,7 +5461,7 @@ pub fn resize_down_with_panes_below_aligned_left_and_right_with_to_the_left_and_ tab.move_focus_left(1); tab.move_focus_up(1); tab.move_focus_left(1); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -5786,7 +5824,7 @@ pub fn cannot_resize_down_when_pane_below_is_at_minimum_height() { let mut tab = create_new_tab(size); tab.horizontal_split(PaneId::Terminal(2), None, 1).unwrap(); tab.move_focus_up(1); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -5827,7 +5865,7 @@ pub fn resize_left_with_pane_to_the_left() { }; let mut tab = create_new_tab(size); tab.vertical_split(PaneId::Terminal(2), None, 1).unwrap(); - tab.resize_left(1); + tab_resize_left(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -5931,7 +5969,7 @@ pub fn resize_left_with_pane_to_the_right() { let mut tab = create_new_tab(size); tab.vertical_split(PaneId::Terminal(2), None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_left(1); + tab_resize_left(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -6037,7 +6075,7 @@ pub fn resize_left_with_panes_to_the_left_and_right() { tab.vertical_split(PaneId::Terminal(2), None, 1).unwrap(); tab.vertical_split(PaneId::Terminal(3), None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_left(1); + tab_resize_left(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -6186,7 +6224,7 @@ pub fn resize_left_with_multiple_panes_to_the_left() { tab.move_focus_left(1); tab.horizontal_split(PaneId::Terminal(3), None, 1).unwrap(); tab.move_focus_right(1); - tab.resize_left(1); + tab_resize_left(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -6337,7 +6375,7 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_with_current_pane() { tab.move_focus_up(1); tab.vertical_split(PaneId::Terminal(4), None, 1).unwrap(); tab.move_focus_down(1); - tab.resize_left(1); + tab_resize_left(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -6532,7 +6570,7 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_with_current_pane() { tab.vertical_split(PaneId::Terminal(4), None, 1).unwrap(); tab.move_focus_down(1); tab.move_focus_left(1); - tab.resize_left(1); + tab_resize_left(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -6725,7 +6763,7 @@ pub fn resize_left_with_panes_to_the_left_aligned_bottom_with_current_pane() { tab.vertical_split(PaneId::Terminal(3), None, 1).unwrap(); tab.move_focus_up(1); tab.vertical_split(PaneId::Terminal(4), None, 1).unwrap(); - tab.resize_left(1); + tab_resize_left(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -6919,7 +6957,7 @@ pub fn resize_left_with_panes_to_the_right_aligned_bottom_with_current_pane() { tab.move_focus_up(1); tab.vertical_split(PaneId::Terminal(4), None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_left(1); + tab_resize_left(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -7118,7 +7156,7 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_and_bottom_with_current_pa tab.move_focus_up(1); tab.vertical_split(PaneId::Terminal(6), None, 1).unwrap(); tab.move_focus_down(1); - tab.resize_left(1); + tab_resize_left(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -7404,7 +7442,7 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_and_bottom_with_current_p tab.vertical_split(PaneId::Terminal(6), None, 1).unwrap(); tab.move_focus_down(1); tab.move_focus_left(1); - tab.resize_left(1); + tab_resize_left(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -7688,12 +7726,12 @@ pub fn resize_left_with_panes_to_the_left_aligned_top_and_bottom_with_panes_abov tab.move_focus_up(1); tab.vertical_split(PaneId::Terminal(5), None, 1).unwrap(); tab.move_focus_down(1); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); tab.vertical_split(PaneId::Terminal(6), None, 1).unwrap(); tab.horizontal_split(PaneId::Terminal(7), None, 1).unwrap(); tab.horizontal_split(PaneId::Terminal(8), None, 1).unwrap(); tab.move_focus_up(1); - tab.resize_left(1); + tab_resize_left(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -8063,13 +8101,13 @@ pub fn resize_left_with_panes_to_the_right_aligned_top_and_bottom_with_panes_abo tab.move_focus_up(1); tab.vertical_split(PaneId::Terminal(5), None, 1).unwrap(); tab.move_focus_down(1); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); tab.vertical_split(PaneId::Terminal(6), None, 1).unwrap(); tab.move_focus_left(1); tab.horizontal_split(PaneId::Terminal(7), None, 1).unwrap(); tab.horizontal_split(PaneId::Terminal(8), None, 1).unwrap(); tab.move_focus_up(1); - tab.resize_left(1); + tab_resize_left(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -8428,7 +8466,7 @@ pub fn cannot_resize_left_when_pane_to_the_left_is_at_minimum_width() { let size = Size { cols: 10, rows: 20 }; let mut tab = create_new_tab(size); tab.vertical_split(PaneId::Terminal(2), None, 1).unwrap(); - tab.resize_left(1); + tab_resize_left(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -8469,7 +8507,7 @@ pub fn resize_right_with_pane_to_the_left() { }; let mut tab = create_new_tab(size); tab.vertical_split(PaneId::Terminal(2), None, 1).unwrap(); - tab.resize_right(1); + tab_resize_right(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -8574,7 +8612,7 @@ pub fn resize_right_with_pane_to_the_right() { let mut tab = create_new_tab(size); tab.vertical_split(PaneId::Terminal(2), None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_right(1); + tab_resize_right(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -8680,7 +8718,7 @@ pub fn resize_right_with_panes_to_the_left_and_right() { tab.vertical_split(PaneId::Terminal(2), None, 1).unwrap(); tab.vertical_split(PaneId::Terminal(3), None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_right(1); + tab_resize_right(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -8830,7 +8868,7 @@ pub fn resize_right_with_multiple_panes_to_the_left() { tab.move_focus_left(1); tab.horizontal_split(PaneId::Terminal(3), None, 1).unwrap(); tab.move_focus_right(1); - tab.resize_right(1); + tab_resize_right(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -8981,7 +9019,7 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_with_current_pane() { tab.horizontal_split(PaneId::Terminal(3), None, 1).unwrap(); tab.move_focus_right(1); tab.horizontal_split(PaneId::Terminal(4), None, 1).unwrap(); - tab.resize_right(1); + tab_resize_right(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -9175,7 +9213,7 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_with_current_pane() { tab.move_focus_right(1); tab.horizontal_split(PaneId::Terminal(4), None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_right(1); + tab_resize_right(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -9370,7 +9408,7 @@ pub fn resize_right_with_panes_to_the_left_aligned_bottom_with_current_pane() { tab.move_focus_right(1); tab.horizontal_split(PaneId::Terminal(4), None, 1).unwrap(); tab.move_focus_up(1); - tab.resize_right(1); + tab_resize_right(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -9566,7 +9604,7 @@ pub fn resize_right_with_panes_to_the_right_aligned_bottom_with_current_pane() { tab.horizontal_split(PaneId::Terminal(4), None, 1).unwrap(); tab.move_focus_up(1); tab.move_focus_left(1); - tab.resize_right(1); + tab_resize_right(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -9765,7 +9803,7 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_and_bottom_with_current_p tab.move_focus_up(1); tab.vertical_split(PaneId::Terminal(6), None, 1).unwrap(); tab.move_focus_down(1); - tab.resize_right(1); + tab_resize_right(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -10050,7 +10088,7 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_and_bottom_with_current_ tab.vertical_split(PaneId::Terminal(6), None, 1).unwrap(); tab.move_focus_down(1); tab.move_focus_left(1); - tab.resize_right(1); + tab_resize_right(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -10333,12 +10371,12 @@ pub fn resize_right_with_panes_to_the_left_aligned_top_and_bottom_with_panes_abo tab.move_focus_up(1); tab.vertical_split(PaneId::Terminal(5), None, 1).unwrap(); tab.move_focus_down(1); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); tab.vertical_split(PaneId::Terminal(6), None, 1).unwrap(); tab.horizontal_split(PaneId::Terminal(7), None, 1).unwrap(); tab.horizontal_split(PaneId::Terminal(8), None, 1).unwrap(); tab.move_focus_up(1); - tab.resize_right(1); + tab_resize_right(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -10707,13 +10745,13 @@ pub fn resize_right_with_panes_to_the_right_aligned_top_and_bottom_with_panes_ab tab.move_focus_up(1); tab.vertical_split(PaneId::Terminal(5), None, 1).unwrap(); tab.move_focus_down(1); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); tab.vertical_split(PaneId::Terminal(6), None, 1).unwrap(); tab.move_focus_left(1); tab.horizontal_split(PaneId::Terminal(7), None, 1).unwrap(); tab.horizontal_split(PaneId::Terminal(8), None, 1).unwrap(); tab.move_focus_up(1); - tab.resize_right(1); + tab_resize_right(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -11071,7 +11109,7 @@ pub fn cannot_resize_right_when_pane_to_the_left_is_at_minimum_width() { let size = Size { cols: 10, rows: 20 }; let mut tab = create_new_tab(size); tab.vertical_split(PaneId::Terminal(2), None, 1).unwrap(); - tab.resize_right(1); + tab_resize_right(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -11113,7 +11151,7 @@ pub fn resize_up_with_pane_above() { }; let mut tab = create_new_tab(size); tab.horizontal_split(PaneId::Terminal(2), None, 1).unwrap(); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -11219,7 +11257,7 @@ pub fn resize_up_with_pane_below() { let mut tab = create_new_tab(size); tab.horizontal_split(PaneId::Terminal(2), None, 1).unwrap(); tab.move_focus_up(1); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -11329,7 +11367,7 @@ pub fn resize_up_with_panes_above_and_below() { tab.horizontal_split(PaneId::Terminal(2), None, 1).unwrap(); tab.horizontal_split(PaneId::Terminal(3), None, 1).unwrap(); tab.move_focus_up(1); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -11479,7 +11517,7 @@ pub fn resize_up_with_multiple_panes_above() { tab.move_focus_up(1); tab.vertical_split(PaneId::Terminal(3), None, 1).unwrap(); tab.move_focus_down(1); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -11629,7 +11667,7 @@ pub fn resize_up_with_panes_above_aligned_left_with_current_pane() { tab.vertical_split(PaneId::Terminal(3), None, 1).unwrap(); tab.move_focus_down(1); tab.vertical_split(PaneId::Terminal(4), None, 1).unwrap(); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -11825,7 +11863,7 @@ pub fn resize_up_with_panes_below_aligned_left_with_current_pane() { tab.move_focus_down(1); tab.vertical_split(PaneId::Terminal(4), None, 1).unwrap(); tab.move_focus_up(1); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -12021,7 +12059,7 @@ pub fn resize_up_with_panes_above_aligned_right_with_current_pane() { tab.move_focus_down(1); tab.vertical_split(PaneId::Terminal(4), None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -12218,7 +12256,7 @@ pub fn resize_up_with_panes_below_aligned_right_with_current_pane() { tab.vertical_split(PaneId::Terminal(4), None, 1).unwrap(); tab.move_focus_left(1); tab.move_focus_up(1); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -12415,7 +12453,7 @@ pub fn resize_up_with_panes_above_aligned_left_and_right_with_current_pane() { tab.vertical_split(PaneId::Terminal(5), None, 1).unwrap(); tab.vertical_split(PaneId::Terminal(6), None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -12699,7 +12737,7 @@ pub fn resize_up_with_panes_below_aligned_left_and_right_with_current_pane() { tab.vertical_split(PaneId::Terminal(6), None, 1).unwrap(); tab.move_focus_left(1); tab.move_focus_up(1); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -12986,7 +13024,7 @@ pub fn resize_up_with_panes_above_aligned_left_and_right_with_panes_to_the_left_ tab.vertical_split(PaneId::Terminal(7), None, 1).unwrap(); tab.vertical_split(PaneId::Terminal(8), None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -13360,7 +13398,7 @@ pub fn resize_up_with_panes_below_aligned_left_and_right_with_to_the_left_and_ri tab.vertical_split(PaneId::Terminal(7), None, 1).unwrap(); tab.vertical_split(PaneId::Terminal(8), None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_up(1); + tab_resize_up(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -13722,7 +13760,7 @@ pub fn cannot_resize_up_when_pane_above_is_at_minimum_height() { }; let mut tab = create_new_tab(size); tab.horizontal_split(PaneId::Terminal(2), None, 1).unwrap(); - tab.resize_down(1); + tab_resize_down(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -13755,7 +13793,7 @@ pub fn nondirectional_resize_increase_with_1_pane() { rows: 10, }; let mut tab = create_new_tab(size); - tab.resize_increase(1); + tab_resize_increase(&mut tab, 1); assert_eq!( tab.get_active_pane(1).unwrap().position_and_size().y, @@ -13779,7 +13817,7 @@ pub fn nondirectional_resize_increase_with_1_pane_to_left() { let mut tab = create_new_tab(size); let new_pane_id_1 = PaneId::Terminal(2); tab.vertical_split(new_pane_id_1, None, 1).unwrap(); - tab.resize_increase(1); + tab_resize_increase(&mut tab, 1); // should behave like `resize_left_with_pane_to_the_left` assert_eq!( @@ -13815,7 +13853,7 @@ pub fn nondirectional_resize_increase_with_2_panes_to_left() { tab.move_focus_left(1); tab.horizontal_split(PaneId::Terminal(3), None, 1).unwrap(); tab.move_focus_right(1); - tab.resize_increase(1); + tab_resize_increase(&mut tab, 1); // should behave like `resize_left_with_multiple_panes_to_the_left` assert_eq!( @@ -13872,7 +13910,7 @@ pub fn nondirectional_resize_increase_with_1_pane_to_right_1_pane_above() { tab.vertical_split(PaneId::Terminal(2), None, 1).unwrap(); tab.move_focus_left(1); tab.horizontal_split(PaneId::Terminal(3), None, 1).unwrap(); - tab.resize_increase(1); + tab_resize_increase(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -13928,7 +13966,7 @@ pub fn nondirectional_resize_increase_with_1_pane_to_right_1_pane_to_left() { tab.vertical_split(PaneId::Terminal(2), None, 1).unwrap(); tab.vertical_split(PaneId::Terminal(3), None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_increase(1); + tab_resize_increase(&mut tab, 1); assert_eq!( tab.tiled_panes @@ -13984,7 +14022,7 @@ pub fn nondirectional_resize_increase_with_pane_above_aligned_right_with_current tab.vertical_split(PaneId::Terminal(2), None, 1).unwrap(); tab.vertical_split(PaneId::Terminal(3), None, 1).unwrap(); tab.move_focus_left(1); - tab.resize_increase(1); + tab_resize_increase(&mut tab, 1); assert_eq!( tab.tiled_panes |
