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
This commit is contained in:
Aram Drevekenin 2024-11-08 20:28:32 +01:00 committed by GitHub
parent 102af0d969
commit 23d2555543
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -941,7 +941,12 @@ 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();
let mut changed_chunks = Vec::new(); let mut changed_chunks = Vec::new();
for line_index in line_changes { for line_index in line_changes {