mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: regression that caused TUI tearing when previewing an image
This commit is contained in:
parent
bdbd552457
commit
64c6cdf072
1 changed files with 5 additions and 3 deletions
|
|
@ -24,6 +24,10 @@ impl Adaptor {
|
||||||
path = cache.as_path();
|
path = cache.as_path();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if IMAGE_SHOWN.swap(true, Ordering::Relaxed) {
|
||||||
|
Self::image_hide(rect).ok();
|
||||||
|
}
|
||||||
|
|
||||||
match PREVIEW.adaptor {
|
match PREVIEW.adaptor {
|
||||||
PreviewAdaptor::Kitty => Kitty::image_show(path, rect).await,
|
PreviewAdaptor::Kitty => Kitty::image_show(path, rect).await,
|
||||||
PreviewAdaptor::Iterm2 => Iterm2::image_show(path, rect).await,
|
PreviewAdaptor::Iterm2 => Iterm2::image_show(path, rect).await,
|
||||||
|
|
@ -31,9 +35,7 @@ impl Adaptor {
|
||||||
_ => Ok(if let Some(tx) = &*UEBERZUG {
|
_ => Ok(if let Some(tx) = &*UEBERZUG {
|
||||||
tx.send(Some((path.to_path_buf(), rect)))?;
|
tx.send(Some((path.to_path_buf(), rect)))?;
|
||||||
}),
|
}),
|
||||||
}?;
|
}
|
||||||
|
|
||||||
Ok(IMAGE_SHOWN.store(true, Ordering::Relaxed))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn image_hide(rect: Rect) -> Result<()> {
|
pub fn image_hide(rect: Rect) -> Result<()> {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue