fix(tui): Avoid unnecessarily re-rendering the user interface
Having the event loop be asynchronous causes too many unnecessary redraws, despite the content not changing.
This commit is contained in:
parent
f91adee1f8
commit
38fe976261
@ -1,6 +1,5 @@
|
||||
use std::path::PathBuf;
|
||||
use std::sync::mpsc;
|
||||
use std::time::Duration;
|
||||
|
||||
use anyhow::Result;
|
||||
use crossterm::event::{self, Event, KeyCode, KeyEvent, KeyModifiers};
|
||||
@ -79,10 +78,6 @@ pub fn run(projects: Projects) -> Result<()> {
|
||||
|
||||
term.draw(|frame| draw(&mut state, frame))?;
|
||||
|
||||
if !event::poll(Duration::from_millis(10))? {
|
||||
continue;
|
||||
}
|
||||
|
||||
if let Event::Key(key_event) = event::read()? {
|
||||
handle_key_event(&mut state, &mut msg_tx, key_event);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user