mirror of
https://github.com/alacritty/alacritty.git
synced 2025-11-06 22:44:18 -05:00
Extract SizeInfo from alacritty_terminal
The `SizeInfo` is a SizeInfo used for rendering, which contains information about padding, and such, however all the terminal need is number of visible lines and columns.
This commit is contained in:
parent
851dbc328e
commit
673710487a
64 changed files with 392 additions and 352 deletions
|
|
@ -11,7 +11,8 @@ use alacritty_terminal::event::{Event, EventListener};
|
|||
use alacritty_terminal::grid::{Dimensions, Grid};
|
||||
use alacritty_terminal::index::{Column, Line};
|
||||
use alacritty_terminal::term::cell::Cell;
|
||||
use alacritty_terminal::term::{SizeInfo, Term};
|
||||
use alacritty_terminal::term::test::TermSize;
|
||||
use alacritty_terminal::term::Term;
|
||||
|
||||
macro_rules! ref_tests {
|
||||
($($name:ident)*) => {
|
||||
|
|
@ -98,14 +99,14 @@ fn ref_test(dir: &Path) {
|
|||
let serialized_grid = fs::read_to_string(dir.join("grid.json")).unwrap();
|
||||
let serialized_cfg = fs::read_to_string(dir.join("config.json")).unwrap();
|
||||
|
||||
let size: SizeInfo = json::from_str(&serialized_size).unwrap();
|
||||
let size: TermSize = json::from_str(&serialized_size).unwrap();
|
||||
let grid: Grid<Cell> = json::from_str(&serialized_grid).unwrap();
|
||||
let ref_config: RefConfig = json::from_str(&serialized_cfg).unwrap();
|
||||
|
||||
let mut config = Config::default();
|
||||
config.scrolling.set_history(ref_config.history_size);
|
||||
|
||||
let mut terminal = Term::new(&config, size, Mock);
|
||||
let mut terminal = Term::new(&config, &size, Mock);
|
||||
let mut parser = ansi::Processor::new();
|
||||
|
||||
for byte in recording {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1916.0,"height":1054.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":106,"screen_lines":30}
|
||||
{"columns":106,"screen_lines":30}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":662.0,"height":708.0,"cell_width":10.0,"cell_height":22.0,"padding_x":0.0,"padding_y":0.0,"columns":66,"screen_lines":32}
|
||||
{"columns":66,"screen_lines":32}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":939.0,"height":1020.0,"cell_width":8.0,"cell_height":16.0,"padding_x":5.0,"padding_y":6.0,"columns":116,"screen_lines":63}
|
||||
{"columns":116,"screen_lines":63}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1262.0,"height":690.0,"cell_width":9.0,"cell_height":18.0,"padding_x":0.0,"padding_y":0.0,"screen_lines":38,"columns":140}
|
||||
{"screen_lines":38,"columns":140}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1916.0,"height":1054.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":106,"screen_lines":30}
|
||||
{"columns":106,"screen_lines":30}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1916.0,"height":1054.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":106,"screen_lines":30}
|
||||
{"columns":106,"screen_lines":30}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1916.0,"height":1054.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":106,"screen_lines":30}
|
||||
{"columns":106,"screen_lines":30}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":939.0,"height":503.0,"cell_width":8.0,"cell_height":16.0,"padding_x":5.0,"padding_y":3.0,"columns":116,"screen_lines":31}
|
||||
{"columns":116,"screen_lines":31}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1916.0,"height":1054.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":106,"screen_lines":30}
|
||||
{"columns":106,"screen_lines":30}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1916.0,"height":1054.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":106,"screen_lines":30}
|
||||
{"columns":106,"screen_lines":30}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":939.0,"height":503.0,"cell_width":8.0,"cell_height":16.0,"padding_x":5.0,"padding_y":3.0,"columns":116,"screen_lines":31}
|
||||
{"columns":116,"screen_lines":31}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1040.0,"cell_width":11.0,"cell_height":22.0,"padding_x":0.0,"padding_y":0.0,"columns":172,"screen_lines":47}
|
||||
{"columns":172,"screen_lines":47}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1259.0,"height":683.0,"cell_width":9.0,"cell_height":19.0,"padding_x":4.0,"padding_y":9.0,"columns":139,"screen_lines":35}
|
||||
{"columns":139,"screen_lines":35}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1259.0,"height":683.0,"cell_width":9.0,"cell_height":19.0,"padding_x":4.0,"padding_y":9.0,"columns":139,"screen_lines":35}
|
||||
{"columns":139,"screen_lines":35}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1840.0,"height":1040.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":102,"screen_lines":29}
|
||||
{"columns":102,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":70.0,"height":63.0,"cell_width":7.0,"cell_height":21.0,"padding_x":0.0,"padding_y":0.0,"columns":10,"screen_lines":3}
|
||||
{"columns":10,"screen_lines":3}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1259.0,"height":683.0,"cell_width":9.0,"cell_height":19.0,"padding_x":4.0,"padding_y":9.0,"columns":139,"screen_lines":35}
|
||||
{"columns":139,"screen_lines":35}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":939.0,"height":1020.0,"cell_width":8.0,"cell_height":16.0,"padding_x":5.0,"padding_y":6.0,"columns":116,"screen_lines":63}
|
||||
{"columns":116,"screen_lines":63}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":948.0,"height":1041.0,"cell_width":7.0,"cell_height":16.0,"padding_x":5.0,"padding_y":8.0,"screen_lines":64,"columns":134}
|
||||
{"screen_lines":64,"columns":134}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1916.0,"height":2121.0,"cell_width":11.0,"cell_height":22.0,"padding_x":0.0,"padding_y":0.0,"columns":174,"screen_lines":96}
|
||||
{"columns":174,"screen_lines":96}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1040.0,"cell_width":11.0,"cell_height":22.0,"padding_x":0.0,"padding_y":0.0,"columns":172,"screen_lines":47}
|
||||
{"columns":172,"screen_lines":47}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":644.0,"height":412.0,"cell_width":8.0,"cell_height":17.0,"padding_x":0.0,"padding_y":0.0,"columns":80,"screen_lines":24}
|
||||
{"columns":80,"screen_lines":24}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":939.0,"height":503.0,"cell_width":8.0,"cell_height":16.0,"padding_x":5.0,"padding_y":3.0,"columns":116,"screen_lines":31}
|
||||
{"columns":116,"screen_lines":31}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1259.0,"height":683.0,"cell_width":9.0,"cell_height":19.0,"padding_x":4.0,"padding_y":9.0,"columns":139,"screen_lines":35}
|
||||
{"columns":139,"screen_lines":35}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1259.0,"height":683.0,"cell_width":9.0,"cell_height":19.0,"padding_x":4.0,"padding_y":9.0,"screen_lines":35,"columns":139}
|
||||
{"screen_lines":35,"columns":139}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"width":1900.0,"height":1038.0,"cell_width":18.0,"cell_height":35.0,"padding_x":0.0,"padding_y":0.0,"columns":105,"screen_lines":29}
|
||||
{"columns":105,"screen_lines":29}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue