terminal: filter out of bounds atoms

This commit is contained in:
Michael Sippel 2021-09-13 01:41:29 +02:00
parent cee6e02a04
commit edb8416f67
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -169,7 +169,7 @@ impl TermOutWriter {
if let Some(view) = self.view.read().unwrap().as_ref() {
let mut out = self.out.write().unwrap();
for pos in dirty_pos.into_iter() {
for pos in dirty_pos.into_iter().filter(|p| p.x >= 0 && p.y >= 0) {
if pos != cur_pos {
write!(out, "{}", termion::cursor::Goto(pos.x as u16 + 1, pos.y as u16 + 1))?;
}