summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpierce <xuanyuan300@gmail.com>2023-12-01 01:21:22 +0800
committerGitHub <noreply@github.com>2023-11-30 18:21:22 +0100
commitb221e472ca9eaab213a723cd1a136a400a06cf30 (patch)
tree34779d53b1e687d0f9972bb6de45a1061110d4e5
parentf46a5160572ccc1c213f0fcffc1c90059c4ef5b2 (diff)
fix: fix flakey scroll history (#2935)
* fix: fix flakey scroll history Signed-off-by: xuanyuan300 <xuanyuan300@gmail.com> * fix: add assertion line Signed-off-by: xuanyuan300 <xuanyuan300@gmail.com> * Update e2e.yml * Update e2e.yml --------- Signed-off-by: xuanyuan300 <xuanyuan300@gmail.com>
-rw-r--r--zellij-server/src/panes/grid.rs4
-rw-r--r--zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__git_diff_scrollup.snap7
-rw-r--r--zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__htop_scrolling.snap3
-rw-r--r--zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_6.snap26
-rw-r--r--zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_7.snap26
-rw-r--r--zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_8.snap26
-rw-r--r--zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_9.snap26
7 files changed, 59 insertions, 59 deletions
diff --git a/zellij-server/src/panes/grid.rs b/zellij-server/src/panes/grid.rs
index 78f018ad5..0613c7e31 100644
--- a/zellij-server/src/panes/grid.rs
+++ b/zellij-server/src/panes/grid.rs
@@ -1528,7 +1528,9 @@ impl Grid {
if scroll_region_bottom < self.viewport.len() {
self.viewport.remove(scroll_region_bottom);
}
- self.viewport.insert(current_line_index, Row::new()); // TODO: .canonical() ?
+
+ self.viewport
+ .insert(current_line_index, Row::new().canonical());
} else if current_line_index > scroll_region_top
&& current_line_index <= scroll_region_bottom
{
diff --git a/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__git_diff_scrollup.snap b/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__git_diff_scrollup.snap
index e4c5e29f0..4320b5b2c 100644
--- a/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__git_diff_scrollup.snap
+++ b/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__git_diff_scrollup.snap
@@ -1,11 +1,10 @@
---
source: zellij-server/src/panes/./unit/grid_tests.rs
expression: "format!(\"{:?}\", grid)"
-
---
-00 (W):
-01 (W): src/terminal_pane/scroll.rs
-02 (W): ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+00 (C):
+01 (C): src/terminal_pane/scroll.rs
+02 (C): ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
03 (C):
04 (C): ────────────────────────────────────────────────┐
05 (C): use crate::terminal_pane::terminal_character::{ │
diff --git a/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__htop_scrolling.snap b/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__htop_scrolling.snap
index 5f6c323d7..90f5227b6 100644
--- a/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__htop_scrolling.snap
+++ b/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__htop_scrolling.snap
@@ -1,7 +1,6 @@
---
source: zellij-server/src/panes/./unit/grid_tests.rs
expression: "format!(\"{:?}\", grid)"
-
---
00 (C):
01 (C): 1 [||||||||||||||||||||||||||||||||||||||||||100.0%] Tasks: 79, 382 thr; 1 running
@@ -12,7 +11,7 @@ expression: "format!(\"{:?}\", grid)"
06 (C): Swp[ 0K/16.0G]
07 (C):
08 (C): PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
-09 (W): 123934 aram 20 0 8444 4384 3364 R 66.7 0.0 0:00.05 htop --delay=100000000000
+09 (C): 123934 aram 20 0 8444 4384 3364 R 66.7 0.0 0:00.05 htop --delay=100000000000
10 (C): 1 root 20 0 171M 11616 8608 S 0.0 0.1 0:56.91 /sbin/init
11 (C): 268 root 20 0 93324 34340 33072 S 0.0 0.2 0:01.05 /usr/lib/systemd/systemd-journald
12 (C): 276 root 20 0 32648 10192 7240 S 0.0 0.1 0:01.13 /usr/lib/systemd/systemd-udevd
diff --git a/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_6.snap b/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_6.snap
index 98cd7fac1..7d7a4ba66 100644
--- a/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_6.snap
+++ b/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_6.snap
@@ -3,19 +3,19 @@ source: zellij-server/src/panes/./unit/grid_tests.rs
assertion_line: 305
expression: "format!(\"{:?}\", grid)"
---
-00 (W): Push <RETURN>
-01 (W): Soft scroll down region [12..13] size 2 Line 29
-02 (W): Soft scroll down region [12..13] size 2 Line 28
-03 (W): Soft scroll down region [12..13] size 2 Line 27
-04 (W): Soft scroll down region [12..13] size 2 Line 26
-05 (W): Soft scroll down region [12..13] size 2 Line 25
-06 (W): Soft scroll down region [12..13] size 2 Line 24
-07 (W): Soft scroll down region [12..13] size 2 Line 23
-08 (W): Soft scroll down region [12..13] size 2 Line 22
-09 (W): Soft scroll down region [12..13] size 2 Line 21
-10 (W): Soft scroll down region [12..13] size 2 Line 20
-11 (W): Soft scroll down region [12..13] size 2 Line 19
-12 (W): Soft scroll down region [12..13] size 2 Line 18
+00 (C): Push <RETURN>
+01 (C): Soft scroll down region [12..13] size 2 Line 29
+02 (C): Soft scroll down region [12..13] size 2 Line 28
+03 (C): Soft scroll down region [12..13] size 2 Line 27
+04 (C): Soft scroll down region [12..13] size 2 Line 26
+05 (C): Soft scroll down region [12..13] size 2 Line 25
+06 (C): Soft scroll down region [12..13] size 2 Line 24
+07 (C): Soft scroll down region [12..13] size 2 Line 23
+08 (C): Soft scroll down region [12..13] size 2 Line 22
+09 (C): Soft scroll down region [12..13] size 2 Line 21
+10 (C): Soft scroll down region [12..13] size 2 Line 20
+11 (C): Soft scroll down region [12..13] size 2 Line 19
+12 (C): Soft scroll down region [12..13] size 2 Line 18
13 (C): Soft scroll down region [12..13] size 2 Line 17
14 (C): Soft scroll down region [12..13] size 2 Line 16
15 (C): Soft scroll down region [12..13] size 2 Line 15
diff --git a/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_7.snap b/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_7.snap
index 734a9f469..e4cf1a226 100644
--- a/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_7.snap
+++ b/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_7.snap
@@ -3,19 +3,19 @@ source: zellij-server/src/panes/./unit/grid_tests.rs
assertion_line: 327
expression: "format!(\"{:?}\", grid)"
---
-00 (W): Push <RETURN>
-01 (W): Soft scroll down region [1..24] size 24 Line 29
-02 (W): Soft scroll down region [1..24] size 24 Line 28
-03 (W): Soft scroll down region [1..24] size 24 Line 27
-04 (W): Soft scroll down region [1..24] size 24 Line 26
-05 (W): Soft scroll down region [1..24] size 24 Line 25
-06 (W): Soft scroll down region [1..24] size 24 Line 24
-07 (W): Soft scroll down region [1..24] size 24 Line 23
-08 (W): Soft scroll down region [1..24] size 24 Line 22
-09 (W): Soft scroll down region [1..24] size 24 Line 21
-10 (W): Soft scroll down region [1..24] size 24 Line 20
-11 (W): Soft scroll down region [1..24] size 24 Line 19
-12 (W): Soft scroll down region [1..24] size 24 Line 18
+00 (C): Push <RETURN>
+01 (C): Soft scroll down region [1..24] size 24 Line 29
+02 (C): Soft scroll down region [1..24] size 24 Line 28
+03 (C): Soft scroll down region [1..24] size 24 Line 27
+04 (C): Soft scroll down region [1..24] size 24 Line 26
+05 (C): Soft scroll down region [1..24] size 24 Line 25
+06 (C): Soft scroll down region [1..24] size 24 Line 24
+07 (C): Soft scroll down region [1..24] size 24 Line 23
+08 (C): Soft scroll down region [1..24] size 24 Line 22
+09 (C): Soft scroll down region [1..24] size 24 Line 21
+10 (C): Soft scroll down region [1..24] size 24 Line 20
+11 (C): Soft scroll down region [1..24] size 24 Line 19
+12 (C): Soft scroll down region [1..24] size 24 Line 18
13 (C): Soft scroll down region [1..24] size 24 Line 17
14 (C): Soft scroll down region [1..24] size 24 Line 16
15 (C): Soft scroll down region [1..24] size 24 Line 15
diff --git a/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_8.snap b/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_8.snap
index 6f313bec7..b18687435 100644
--- a/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_8.snap
+++ b/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_8.snap
@@ -3,19 +3,19 @@ source: zellij-server/src/panes/./unit/grid_tests.rs
assertion_line: 349
expression: "format!(\"{:?}\", grid)"
---
-00 (W): Push <RETURN>
-01 (W): Jump scroll down region [12..13] size 2 Line 29
-02 (W): Jump scroll down region [12..13] size 2 Line 28
-03 (W): Jump scroll down region [12..13] size 2 Line 27
-04 (W): Jump scroll down region [12..13] size 2 Line 26
-05 (W): Jump scroll down region [12..13] size 2 Line 25
-06 (W): Jump scroll down region [12..13] size 2 Line 24
-07 (W): Jump scroll down region [12..13] size 2 Line 23
-08 (W): Jump scroll down region [12..13] size 2 Line 22
-09 (W): Jump scroll down region [12..13] size 2 Line 21
-10 (W): Jump scroll down region [12..13] size 2 Line 20
-11 (W): Jump scroll down region [12..13] size 2 Line 19
-12 (W): Jump scroll down region [12..13] size 2 Line 18
+00 (C): Push <RETURN>
+01 (C): Jump scroll down region [12..13] size 2 Line 29
+02 (C): Jump scroll down region [12..13] size 2 Line 28
+03 (C): Jump scroll down region [12..13] size 2 Line 27
+04 (C): Jump scroll down region [12..13] size 2 Line 26
+05 (C): Jump scroll down region [12..13] size 2 Line 25
+06 (C): Jump scroll down region [12..13] size 2 Line 24
+07 (C): Jump scroll down region [12..13] size 2 Line 23
+08 (C): Jump scroll down region [12..13] size 2 Line 22
+09 (C): Jump scroll down region [12..13] size 2 Line 21
+10 (C): Jump scroll down region [12..13] size 2 Line 20
+11 (C): Jump scroll down region [12..13] size 2 Line 19
+12 (C): Jump scroll down region [12..13] size 2 Line 18
13 (C): Jump scroll down region [12..13] size 2 Line 17
14 (C): Jump scroll down region [12..13] size 2 Line 16
15 (C): Jump scroll down region [12..13] size 2 Line 15
diff --git a/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_9.snap b/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_9.snap
index fed2d986d..eb18b942a 100644
--- a/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_9.snap
+++ b/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__vttest2_9.snap
@@ -3,19 +3,19 @@ source: zellij-server/src/panes/./unit/grid_tests.rs
assertion_line: 371
expression: "format!(\"{:?}\", grid)"
---
-00 (W): Push <RETURN>
-01 (W): Jump scroll down region [1..24] size 24 Line 29
-02 (W): Jump scroll down region [1..24] size 24 Line 28
-03 (W): Jump scroll down region [1..24] size 24 Line 27
-04 (W): Jump scroll down region [1..24] size 24 Line 26
-05 (W): Jump scroll down region [1..24] size 24 Line 25
-06 (W): Jump scroll down region [1..24] size 24 Line 24
-07 (W): Jump scroll down region [1..24] size 24 Line 23
-08 (W): Jump scroll down region [1..24] size 24 Line 22
-09 (W): Jump scroll down region [1..24] size 24 Line 21
-10 (W): Jump scroll down region [1..24] size 24 Line 20
-11 (W): Jump scroll down region [1..24] size 24 Line 19
-12 (W): Jump scroll down region [1..24] size 24 Line 18
+00 (C): Push <RETURN>
+01 (C): Jump scroll down region [1..24] size 24 Line 29
+02 (C): Jump scroll down region [1..24] size 24 Line 28
+03 (C): Jump scroll down region [1..24] size 24 Line 27
+04 (C): Jump scroll down region [1..24] size 24 Line 26
+05 (C): Jump scroll down region [1..24] size 24 Line 25
+06 (C): Jump scroll down region [1..24] size 24 Line 24
+07 (C): Jump scroll down region [1..24] size 24 Line 23
+08 (C): Jump scroll down region [1..24] size 24 Line 22
+09 (C): Jump scroll down region [1..24] size 24 Line 21
+10 (C): Jump scroll down region [1..24] size 24 Line 20
+11 (C): Jump scroll down region [1..24] size 24 Line 19
+12 (C): Jump scroll down region [1..24] size 24 Line 18
13 (C): Jump scroll down region [1..24] size 24 Line 17
14 (C): Jump scroll down region [1..24] size 24 Line 16
15 (C): Jump scroll down region [1..24] size 24 Line 15