also fix for cases where the changed lines are not contiguous

This commit is contained in:
Aram Drevekenin 2024-11-08 19:45:25 +01:00
parent 530c4d3d1d
commit 8efbd818d2

View File

@ -941,9 +941,13 @@ impl OutputBuffer {
} }
changed_chunks changed_chunks
} else { } 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.sort_unstable();
line_changes.truncate(viewport_height);
let mut changed_chunks = Vec::new(); let mut changed_chunks = Vec::new();
for line_index in line_changes { for line_index in line_changes {
let terminal_characters = let terminal_characters =