This commit is contained in:
sxyazi 2023-11-23 21:25:28 +08:00
parent 83d00ac307
commit c1fedcf49a
No known key found for this signature in database

View file

@ -81,7 +81,7 @@ impl App {
return Ok(());
};
COLLISION.store(false, Ordering::Relaxed);
let collision = COLLISION.swap(false, Ordering::Relaxed);
let frame = term.draw(|f| {
yazi_plugin::scope(&self.cx, |_| {
f.render_widget(Root::new(&self.cx), f.size());
@ -92,6 +92,11 @@ impl App {
}
})?;
if !COLLISION.load(Ordering::Relaxed) {
if collision {
// Reload preview if collision is resolved
self.cx.manager.active_mut().preview.reset();
self.cx.manager.peek(0);
}
return Ok(());
}