mod discovery;
mod input;
mod overlay;
#[cfg(test)]
mod tests;
use std::path::Path;
use crate::{
core::{EntryKind, FileClass},
file_info::{PreviewKind, inspect_path},
};
#[cfg_attr(not(target_os = "macos"), allow(dead_code))]
pub(super) fn path_is_text_like(path: &Path) -> bool {
let facts = inspect_path(path, EntryKind::File);
match facts.preview.kind {
PreviewKind::Markdown | PreviewKind::Csv => true,
PreviewKind::Source => facts.builtin_class != FileClass::Image,
PreviewKind::PlainText => {
facts.preview.document_format.is_none()
&& !matches!(
facts.builtin_class,
FileClass::Image
| FileClass::Audio
| FileClass::Video
| FileClass::Archive
| FileClass::Font
)
}
_ => false,
}
}