diff --git a/src/app.rs b/src/app.rs index a776c35..b8b5ebe 100644 --- a/src/app.rs +++ b/src/app.rs @@ -207,20 +207,6 @@ impl App { let mut changes_since_last_render = true; loop { - if changes_since_last_render { - tui.draw(|f| { - for component in self.components.iter_mut() { - let r = component.draw(f, f.size(), &self.buffers); - if let Err(e) = r { - action_tx - .send(Action::Error(format!("Failed to draw: {:?}", e))) - .unwrap(); - } - } - })?; - changes_since_last_render = false; - } - tokio::select! { e = tui.next() => { if let Some(e) = e { @@ -289,7 +275,19 @@ impl App { changes_since_last_render = true; }, Action::Render => { - // Merely used as a way to signify it's time to render any pending update + if changes_since_last_render { + tui.draw(|f| { + for component in self.components.iter_mut() { + let r = component.draw(f, f.size(), &self.buffers); + if let Err(e) = r { + action_tx + .send(Action::Error(format!("Failed to draw: {:?}", e))) + .unwrap(); + } + } + })?; + changes_since_last_render = false; + } }, Action::RunCommand(ref command_line) => { changes_since_last_render = true;