From 4e318f4fd8e9d8f23cbdaba0dcb787025d1c9f5b Mon Sep 17 00:00:00 2001 From: john li Date: Sun, 22 Aug 2021 16:33:52 -0400 Subject: [PATCH] fix flickering issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit turns out terminal.clear() isn't needed 🤦 --- src/sterm.rs | 7 +------ src/view.rs | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/sterm.rs b/src/sterm.rs index 214ee39..3adf966 100644 --- a/src/sterm.rs +++ b/src/sterm.rs @@ -19,12 +19,7 @@ impl STerm { STerm { terminal } } - // proxying the only tui::Terminal methods needed. if we need more, maybe just - // use terminal directly. - pub fn clear(&mut self) -> std::io::Result<()> { - self.terminal.clear() - } - + // proxying the only tui::Terminal method needed. // LEARN: why doesn't this work? (error about sized types, etc) // pub fn draw(&mut self, f: FnOnce(&mut tui::Frame)) -> std::io::Result<()> { pub fn draw(&mut self, f: F) -> std::io::Result<()> diff --git a/src/view.rs b/src/view.rs index 01c50e4..2ddabf6 100644 --- a/src/view.rs +++ b/src/view.rs @@ -133,7 +133,6 @@ impl View { // erhm, borrow checker workarounds... let alert = self.alert.clone(); let sort_by = self.sort_by.clone(); - self.sterm.clear()?; self.sterm.draw(|f| { let main_constraints = if alert.is_some() { vec![Constraint::Min(3), Constraint::Min(1)]