alacritty/alacritty_terminal/tests/ref
Christian Duerr 3bd5ac221a
Unify the grid line indexing types
Previously Alacritty was using two different ways to reference lines in
the terminal. Either a `usize`, or a `Line(usize)`. These indexing
systems both served different purposes, but made it difficult to reason
about logic involving these systems because of its inconsistency.

To resolve this issue, a single new `Line(i32)` type has been
introduced.  All existing references to lines and points now rely on
this definition of a line.

The indexing starts at the top of the terminal region with the line 0,
which matches the line 1 used by escape sequences. Each line in the
history becomes increasingly negative and the bottommost line is equal
to the number of visible lines minus one.

Having a system which goes into the negatives allows following the
escape sequence's indexing system closely, while at the same time making
it trivial to implement `Ord` for points.

The Alacritty UI crate is the only place which has a different indexing
system, since rendering and input puts the zero line at the top of the
viewport, rather than the top of the terminal region.

All instances which refer to a number of lines/columns instead of just a
single Line/Column have also been changed to use a `usize` instead. This
way a Line/Column will always refer to a specific place in the grid and
no confusion is created by having a count of lines as a possible index
into the grid storage.
2021-03-30 23:25:38 +00:00
..
alt_reset Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
clear_underline Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
colored_reset Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
csi_rep Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
decaln_reset Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
deccolm_reset Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
delete_chars_reset Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
delete_lines Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
erase_chars_reset Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
fish_cc Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
grid_reset Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
history Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
indexed_256_colors Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
insert_blank_reset Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
issue_855 Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
ll Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
newline_with_cursor_beyond_scroll_region Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
region_scroll_down Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
row_reset Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
saved_cursor Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
saved_cursor_alt Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
scroll_up_reset Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
selective_erasure Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
sgr Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
tab_rendering Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
tmux_git_log Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
tmux_htop Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
underline Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
vim_24bitcolors_bce Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
vim_large_window_scroll Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
vim_simple_edit Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
vttest_cursor_movement_1 Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
vttest_insert Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
vttest_origin_mode_1 Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
vttest_origin_mode_2 Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
vttest_scroll Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
vttest_tab_clear_set Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
wrapline_alt_toggle Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
zerowidth Unify the grid line indexing types 2021-03-30 23:25:38 +00:00
zsh_tab_completion Unify the grid line indexing types 2021-03-30 23:25:38 +00:00