mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-18 13:55:23 -05:00
Fix scroll down escape pulling lines from history
This works around a bug where the optimized version of the `Grid::scroll_down` function would just rotate the entire grid down if the scrolling region starts at the top of the screen, even if there is history available. Since rotations of scrolling regions should not affect the scrollback history, this optimized version is now only called when the max scrollback size is 0, making it impossible for the grid to have any history while it is used. Since the main usecase of this is the alternate screen buffer, which never has any history, the performance should not be affected negatively by this change. Fixes #3582.
This commit is contained in:
parent
f0775b3c89
commit
6c8966f426
7 changed files with 52 additions and 3 deletions
|
@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- Slow startup with Nvidia binary drivers on some X11 systems
|
||||
- Display not scrolling when printing new lines while scrolled in history
|
||||
- Regression in font rendering on macOS
|
||||
- Scroll down escape (`CSI Ps T`) incorrectly pulling lines from history
|
||||
|
||||
## 0.4.3
|
||||
|
||||
|
|
|
@ -238,13 +238,11 @@ impl<T: GridCell + Default + PartialEq + Copy> Grid<T> {
|
|||
// changing the start index.
|
||||
//
|
||||
// To accommodate scroll regions, rows are reordered at the end.
|
||||
if region.start == Line(0) {
|
||||
if region.start == Line(0) && self.max_scroll_limit == 0 {
|
||||
// Rotate the entire line buffer. If there's a scrolling region
|
||||
// active, the bottom lines are restored in the next step.
|
||||
self.raw.rotate_up(*positions);
|
||||
|
||||
self.decrease_scroll_limit(*positions);
|
||||
|
||||
// Now, restore any scroll region lines.
|
||||
let lines = self.lines;
|
||||
for i in IndexRange(region.end..lines) {
|
||||
|
|
|
@ -62,6 +62,7 @@ ref_tests! {
|
|||
erase_chars_reset
|
||||
scroll_up_reset
|
||||
clear_underline
|
||||
region_scroll_down
|
||||
}
|
||||
|
||||
fn read_u8<P>(path: P) -> Vec<u8>
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
[1m[7m%[27m[1m[0m
[0m[27m[24m[J[38;5;0;48;5;9m UL [0m[38;5;7;48;5;8m ~/…/tests/ref/region_scroll_… [0m[38;5;0;48;5;9m scroll_down [0m [K
[0m[27m[24m[J[38;5;0;48;5;9m UL [0m[38;5;7;48;5;8m ~/…/tests/ref/region_scroll_… [0m[38;5;0;48;5;9m scroll_down [0m [K[?2004he[37mcho -ne "\e[10000T" && sleep infinity[39m[37De[39mc[39mh[39mo[39m [39m"[37mt[37me[37ms[37mt[37m"[39m[39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [32D[39mt[39me[39ms[39mt[39m"[?2004l
|
||||
test
|
||||
[1m[7m%[27m[1m[0m
[0m[27m[24m[J[38;5;0;48;5;9m UL [0m[38;5;7;48;5;8m ~/…/tests/ref/region_scroll_… [0m[38;5;0;48;5;9m scroll_down [0m [K
[0m[27m[24m[J[38;5;0;48;5;9m UL [0m[38;5;7;48;5;8m ~/…/tests/ref/region_scroll_… [0m[38;5;0;48;5;9m scroll_down [0m [K[?2004hl[37ms[39ml[39ms [37m-lah[39m[39m-[39ml[39ma[39mh[?2004l
|
||||
total 12K
|
||||
drwxr-xr-x 2 undeadleech undeadleech 4.0K Jun 24 23:58 [0m[34m.[0m
|
||||
drwxr-xr-x 37 undeadleech undeadleech 4.0K Jun 24 23:57 [34m..[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 1.3K Jun 24 23:58 [32malacritty.recording[0m
|
||||
[1m[7m%[27m[1m[0m
[0m[27m[24m[J[38;5;0;48;5;9m UL [0m[38;5;7;48;5;8m ~/…/tests/ref/region_scroll_… [0m[38;5;0;48;5;9m scroll_down [0m [K
[0m[27m[24m[J[38;5;0;48;5;9m UL [0m[38;5;7;48;5;8m ~/…/tests/ref/region_scroll_… [0m[38;5;0;48;5;9m scroll_down [0m [K[?2004hls -lah[?2004l
|
||||
total 12K
|
||||
drwxr-xr-x 2 undeadleech undeadleech 4.0K Jun 24 23:58 [0m[34m.[0m
|
||||
drwxr-xr-x 37 undeadleech undeadleech 4.0K Jun 24 23:57 [34m..[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 1.9K Jun 24 23:58 [32malacritty.recording[0m
|
||||
[1m[7m%[27m[1m[0m
[0m[27m[24m[J[38;5;0;48;5;9m UL [0m[38;5;7;48;5;8m ~/…/tests/ref/region_scroll_… [0m[38;5;0;48;5;9m scroll_down [0m [K
[0m[27m[24m[J[38;5;0;48;5;9m UL [0m[38;5;7;48;5;8m ~/…/tests/ref/region_scroll_… [0m[38;5;0;48;5;9m scroll_down [0m [K[?2004hl[37ms -lah[39ml[39ms[39m [39m-[39ml[39ma[39mh [37mbin/snapshot[39m[12D[39m.[37mu[37mn[37md[37mo[37m/[39m[39m [39m [39m [39m [39m [39m [11D[39m.[37m/[37mm[37mo[37mv[39m[39m/[39m.[37m.[39m[39m [39m./../..[?2004l
|
||||
total 300K
|
||||
drwxr-xr-x 15 undeadleech undeadleech 4.0K Jun 24 23:53 [0m[34m.[0m
|
||||
drwxr-xr-x 34 undeadleech undeadleech 4.0K Jun 18 03:26 [34m..[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 10 Feb 8 2019 [32m.agignore[0m
|
||||
drwxr-xr-x 3 undeadleech undeadleech 4.0K Jun 24 23:24 [34malacritty[0m
|
||||
drwxr-xr-x 4 undeadleech undeadleech 4.0K Jun 24 23:24 [34malacritty_terminal[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 21K Jun 24 23:24 [32malacritty.yml[0m
|
||||
drwxr-xr-x 2 undeadleech undeadleech 4.0K Jun 24 18:47 [34m.builds[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 116K Jun 24 23:24 [32mCargo.lock[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 141 Jun 23 21:20 [32mCargo.toml[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 30K Jun 24 23:53 [32mCHANGELOG.md[0m
|
||||
drwxr-xr-x 2 undeadleech undeadleech 4.0K Jun 24 18:47 [34mci[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 7.3K Jun 23 21:20 [32mCONTRIBUTING.md[0m
|
||||
drwxr-xr-x 2 undeadleech undeadleech 4.0K Mar 6 00:06 [34m.copr[0m
|
||||
drwxr-xr-x 2 undeadleech undeadleech 4.0K Feb 8 2019 [34mdocs[0m
|
||||
drwxr-xr-x 7 undeadleech undeadleech 4.0K Jun 23 21:20 [34mextra[0m
|
||||
drwxr-xr-x 3 undeadleech undeadleech 4.0K Jun 23 21:20 [34mfont[0m
|
||||
drwxr-xr-x 8 undeadleech undeadleech 4.0K Jun 24 23:58 [34m.git[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 26 Jun 23 21:20 [32m.gitattributes[0m
|
||||
drwxr-xr-x 2 undeadleech undeadleech 4.0K Jun 23 21:20 [34m.github[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 341 Jun 23 21:20 [32m.gitignore[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 8.9K Jun 23 21:20 [32mINSTALL.md[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 11K Jun 23 21:20 [32mLICENSE-APACHE[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 1.5K Jun 23 21:20 [32mMakefile[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 7.1K Jun 23 21:20 [32mREADME.md[0m
|
||||
drwxr-xr-x 2 undeadleech undeadleech 4.0K Jun 23 21:20 [34mres[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 358 Mar 6 00:06 [32mrustfmt.toml[0m
|
||||
drwxr-xr-x 2 undeadleech undeadleech 4.0K Jun 23 21:20 [34mscripts[0m
|
||||
drwxr-xr-x 4 undeadleech undeadleech 4.0K Jun 20 23:09 [34mtarget[0m
|
||||
-rw-r--r-- 1 undeadleech undeadleech 2.6K Jun 24 18:47 [32m.travis.yml[0m
|
||||
[1m[7m%[27m[1m[0m
[0m[27m[24m[J[38;5;0;48;5;9m UL [0m[38;5;7;48;5;8m ~/…/tests/ref/region_scroll_… [0m[38;5;0;48;5;9m scroll_down [0m [K
[0m[27m[24m[J[38;5;0;48;5;9m UL [0m[38;5;7;48;5;8m ~/…/tests/ref/region_scroll_… [0m[38;5;0;48;5;9m scroll_down [0m [K[?2004he[37mcho "test"[39m[10De[39mc[39mh[39mo[39m [39m-[37mn[37me[37m [37m"[37m\[37me[10000T" && sleep infinity[39m[32D[39me[37m [37m"[37m\[37me[37m[[37m1[39m[4P[21C [31D[39m [39m"[39m\[39me[39m[[39m1[39m0[37m0[37m1[37m[[37me[37m\[37m"[37m [37mn[37me[37m [37m"[37m\[37me[37m[[37m1[37m0[37m0[37m0[37m0[37mT[37m"[37m [37m&[37m&[37m [37ms[37ml[37me[37me[37mp[37m [37mi[37mn[37mf[37mi[37mnity[39m[32D[39mn[39me[39m [39m"[39m\[39me[39m[[39m1[39m0[39m0[39m0[39m0[39mT[39m"[39m [39m&[39m&[39m [39ms[39ml[39me[39me[39mp[39m [39mi[39mn[39mf[39mi[39mn[39mi[39mt[39my[?2004l
|
||||
[10000T^C
|
||||
[1m[7m%[27m[1m[0m
[0m[27m[24m[J[38;5;0;48;5;9m UL [0m[38;5;7;48;5;8m ~/…/tests/ref/region_scroll_… [0m[38;5;0;48;5;9m scroll_down [0m [K
[0m[27m[24m[J[38;5;0;48;5;9m UL [0m[38;5;7;48;5;8m ~/…/tests/ref/region_scroll_… [0m[38;5;0;48;5;9m scroll_down [0m [K[?2004he[37mcho -ne "\e[10000T" && sleep infinity[39m[37De[39mx[37mi[37mt[39m[39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [39m [36D[39mi[39mt[?2004l
|
|
@ -0,0 +1 @@
|
|||
{"history_size":10}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
{"width":939.0,"height":503.0,"cell_width":8.0,"cell_height":16.0,"padding_x":5.0,"padding_y":3.0,"dpr":1.0}
|
Loading…
Reference in a new issue