Skip to content

Commit

Permalink
fix flickering issue
Browse files Browse the repository at this point in the history
turns out terminal.clear() isn't needed 🤦
  • Loading branch information
jli committed Aug 22, 2021
1 parent be6ab6b commit 4e318f4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 1 addition & 6 deletions src/sterm.rs
Expand Up @@ -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<CTBackend>)) -> std::io::Result<()> {
pub fn draw<F>(&mut self, f: F) -> std::io::Result<()>
Expand Down
1 change: 0 additions & 1 deletion src/view.rs
Expand Up @@ -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)]
Expand Down

0 comments on commit 4e318f4

Please sign in to comment.