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
clear_underline
colored_reset
csi_rep
decaln_reset
deccolm_reset
delete_chars_reset
delete_lines
erase_chars_reset
fish_cc
grid_reset
history
indexed_256_colors
insert_blank_reset
issue_855
ll
newline_with_cursor_beyond_scroll_region
region_scroll_down
row_reset
saved_cursor
saved_cursor_alt
scroll_up_reset
selective_erasure
sgr
tab_rendering
tmux_git_log
tmux_htop
underline
vim_24bitcolors_bce
vim_large_window_scroll
vim_simple_edit
vttest_cursor_movement_1
vttest_insert
vttest_origin_mode_1
vttest_origin_mode_2
vttest_scroll
vttest_tab_clear_set
wrapline_alt_toggle
zerowidth
zsh_tab_completion