From e490a2ce04ed0e5cff36e3b260ff9779484204e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Mon, 30 Mar 2026 23:17:59 +0200 Subject: [PATCH] regular refresh --- src/tui/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tui/mod.rs b/src/tui/mod.rs index 1461f67..8a70af7 100644 --- a/src/tui/mod.rs +++ b/src/tui/mod.rs @@ -13,6 +13,7 @@ use std::{ path::{Path, PathBuf}, process::exit, sync::Arc, + time::Duration, }; use tui_widget_list::{ListBuilder, ListView}; @@ -408,6 +409,11 @@ impl App { terminal.draw(|frame| frame.render_widget(&mut self, frame.area()))?; + // update every 250ms or more if there's an event + if !event::poll(Duration::from_millis(250))? { + continue; + } + match event::read()? { Event::Key(key) => { // to initialize, but we then do get manually for borrow reasons @@ -507,9 +513,9 @@ impl App { let block = Block::bordered() .style(styles.default) .border_style(if selected { - styles.border - } else { styles.border_highlighted + } else { + styles.border }); let inner = block.inner(area); block.render(area, buf);