diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-05-30 20:45:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-30 20:45:44 +0000 |
commit | 1dacc99183373bffa3ba287aa3241f3b1da67016 (patch) | |
tree | d5dbefde927b02bff10e29d8596a0bfab65d88f1 /alacritty_terminal/src/grid/tests.rs | |
parent | f7fb67f870943f3f760826b748c8463b8e434983 (diff) | |
download | alacritty-1dacc99183373bffa3ba287aa3241f3b1da67016.tar.gz alacritty-1dacc99183373bffa3ba287aa3241f3b1da67016.zip |
Refactor Term/Grid separation
This commit aims to clear up the separation between Term and Grid to
make way for implementing search.
The `cursor` and `cursor_save` have been moved to the grid, since
they're always bound to their specific grid and this makes updating
easier.
Since the selection is independent of the active grid, it has been moved
to the `Term`.
Diffstat (limited to 'alacritty_terminal/src/grid/tests.rs')
-rw-r--r-- | alacritty_terminal/src/grid/tests.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/alacritty_terminal/src/grid/tests.rs b/alacritty_terminal/src/grid/tests.rs index ef011d16..04400afc 100644 --- a/alacritty_terminal/src/grid/tests.rs +++ b/alacritty_terminal/src/grid/tests.rs @@ -79,7 +79,7 @@ fn scroll_up() { grid[Line(i)][Column(0)] = i; } - grid.scroll_up(&(Line(0)..Line(10)), Line(2), &0); + grid.scroll_up(&(Line(0)..Line(10)), Line(2), 0); assert_eq!(grid[Line(0)][Column(0)], 2); assert_eq!(grid[Line(0)].occ, 1); @@ -111,7 +111,7 @@ fn scroll_down() { grid[Line(i)][Column(0)] = i; } - grid.scroll_down(&(Line(0)..Line(10)), Line(2), &0); + grid.scroll_down(&(Line(0)..Line(10)), Line(2), 0); assert_eq!(grid[Line(0)][Column(0)], 0); // was 8. assert_eq!(grid[Line(0)].occ, 0); @@ -183,7 +183,7 @@ fn shrink_reflow() { grid[Line(0)][Column(3)] = cell('4'); grid[Line(0)][Column(4)] = cell('5'); - grid.resize(true, Line(1), Column(2), &mut Point::new(Line(0), Column(0)), &Cell::default()); + grid.resize(true, Line(1), Column(2)); assert_eq!(grid.len(), 3); @@ -209,8 +209,8 @@ fn shrink_reflow_twice() { grid[Line(0)][Column(3)] = cell('4'); grid[Line(0)][Column(4)] = cell('5'); - grid.resize(true, Line(1), Column(4), &mut Point::new(Line(0), Column(0)), &Cell::default()); - grid.resize(true, Line(1), Column(2), &mut Point::new(Line(0), Column(0)), &Cell::default()); + grid.resize(true, Line(1), Column(4)); + grid.resize(true, Line(1), Column(2)); assert_eq!(grid.len(), 3); @@ -236,7 +236,7 @@ fn shrink_reflow_empty_cell_inside_line() { grid[Line(0)][Column(3)] = cell('4'); grid[Line(0)][Column(4)] = Cell::default(); - grid.resize(true, Line(1), Column(2), &mut Point::new(Line(0), Column(0)), &Cell::default()); + grid.resize(true, Line(1), Column(2)); assert_eq!(grid.len(), 2); @@ -248,7 +248,7 @@ fn shrink_reflow_empty_cell_inside_line() { assert_eq!(grid[0][Column(0)], cell('3')); assert_eq!(grid[0][Column(1)], cell('4')); - grid.resize(true, Line(1), Column(1), &mut Point::new(Line(0), Column(0)), &Cell::default()); + grid.resize(true, Line(1), Column(1)); assert_eq!(grid.len(), 4); @@ -273,7 +273,7 @@ fn grow_reflow() { grid[Line(1)][Column(0)] = cell('3'); grid[Line(1)][Column(1)] = Cell::default(); - grid.resize(true, Line(2), Column(3), &mut Point::new(Line(0), Column(0)), &Cell::default()); + grid.resize(true, Line(2), Column(3)); assert_eq!(grid.len(), 2); @@ -299,7 +299,7 @@ fn grow_reflow_multiline() { grid[Line(2)][Column(0)] = cell('5'); grid[Line(2)][Column(1)] = cell('6'); - grid.resize(true, Line(3), Column(6), &mut Point::new(Line(0), Column(0)), &Cell::default()); + grid.resize(true, Line(3), Column(6)); assert_eq!(grid.len(), 3); @@ -330,7 +330,7 @@ fn grow_reflow_disabled() { grid[Line(1)][Column(0)] = cell('3'); grid[Line(1)][Column(1)] = Cell::default(); - grid.resize(false, Line(2), Column(3), &mut Point::new(Line(0), Column(0)), &Cell::default()); + grid.resize(false, Line(2), Column(3)); assert_eq!(grid.len(), 2); @@ -354,7 +354,7 @@ fn shrink_reflow_disabled() { grid[Line(0)][Column(3)] = cell('4'); grid[Line(0)][Column(4)] = cell('5'); - grid.resize(false, Line(1), Column(2), &mut Point::new(Line(0), Column(0)), &Cell::default()); + grid.resize(false, Line(1), Column(2)); assert_eq!(grid.len(), 1); |