From edb8416f6795ad49aee0b670c21985ec4fcfb4e4 Mon Sep 17 00:00:00 2001 From: Michael Sippel Date: Mon, 13 Sep 2021 01:41:29 +0200 Subject: [PATCH] terminal: filter out of bounds atoms --- nested/src/terminal/terminal.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nested/src/terminal/terminal.rs b/nested/src/terminal/terminal.rs index c7b1d91..b34bf1c 100644 --- a/nested/src/terminal/terminal.rs +++ b/nested/src/terminal/terminal.rs @@ -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))?; }