From 8efbd818d289e10eb84a23e2b5918b8a2c7789f7 Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Fri, 8 Nov 2024 19:45:25 +0100 Subject: [PATCH] also fix for cases where the changed lines are not contiguous --- zellij-server/src/output/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zellij-server/src/output/mod.rs b/zellij-server/src/output/mod.rs index 4fcebea35..ccb5f6653 100644 --- a/zellij-server/src/output/mod.rs +++ b/zellij-server/src/output/mod.rs @@ -941,9 +941,13 @@ impl OutputBuffer { } changed_chunks } else { - let mut line_changes: Vec<_> = self.changed_lines.iter().copied().collect(); + let mut line_changes: Vec<_> = self + .changed_lines + .iter() + .filter(|i| *i < &viewport_height) + .copied() + .collect(); line_changes.sort_unstable(); - line_changes.truncate(viewport_height); let mut changed_chunks = Vec::new(); for line_index in line_changes { let terminal_characters =