From c1fedcf49af4fd254277edc6e1db7d36fd2ad7ab Mon Sep 17 00:00:00 2001 From: sxyazi Date: Thu, 23 Nov 2023 21:25:28 +0800 Subject: [PATCH] .. --- yazi-fm/src/app.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/yazi-fm/src/app.rs b/yazi-fm/src/app.rs index 64481935..f6523f9e 100644 --- a/yazi-fm/src/app.rs +++ b/yazi-fm/src/app.rs @@ -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(()); }