chore: minor reliability corrections

This commit is contained in:
Loric ANDRE 2026-09-05 19:10:34 +02:00
parent 106f9f883a
commit 0029c31fbe
2 changed files with 6 additions and 3 deletions

View file

@ -599,7 +599,7 @@ impl App {
u16::try_from(u32::from(self.preview.cols) * u32::from(p) / 100).unwrap_or(u16::MAX)
}
};
self.preview.scroll_x = usize::from(h_scroll.saturating_add(h_offset));
self.preview.scroll_x = usize::from(h_scroll).saturating_add(usize::from(h_offset));
}
ItemPreview::TextWithPos(t, preview_position) | ItemPreview::AnsiWithPos(t, preview_position) => self
.preview

View file

@ -602,8 +602,11 @@ impl Preview {
terminate_plain_child(&child);
let stdout = stdout_reader.join().unwrap_or_default();
let stderr = stderr_reader.join().unwrap_or_default();
if let Ok(mut guard) = child.lock() {
guard.take();
if let Ok(mut guard) = child.lock()
&& let Some(mut child) = guard.take()
&& status.is_none()
{
let _ = child.wait();
}
let Some(status) = status else {