From 23d2555543acfbffac897e0afca85aff0ea66044 Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Fri, 8 Nov 2024 20:28:32 +0100 Subject: [PATCH] fix(output-buffer): truncate grid height when not rendering it fully (#3750) * fix(output-buffer): truncate grid height when not rendering it fully * also fix for cases where the changed lines are not contiguous --- zellij-server/src/output/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zellij-server/src/output/mod.rs b/zellij-server/src/output/mod.rs index 7ad7a38b..ccb5f665 100644 --- a/zellij-server/src/output/mod.rs +++ b/zellij-server/src/output/mod.rs @@ -941,7 +941,12 @@ 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(); let mut changed_chunks = Vec::new(); for line_index in line_changes {