From 89f75b34add50b8876e3801cb8bdddcb5ff003ea Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Wed, 7 Jan 2026 09:59:46 -0800 Subject: [PATCH] Minor: Make "heuristic" predicate positive, and document Make the partition "heuristic" predicate a positive match, in line with the "systemic" predicate, and document its expected semantics for future readers. Update the only call site to match. --- yazi-fs/src/mounts/partition.rs | 4 +++- yazi-vfs/src/files.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/yazi-fs/src/mounts/partition.rs b/yazi-fs/src/mounts/partition.rs index 9ba45b6f..05eaf77b 100644 --- a/yazi-fs/src/mounts/partition.rs +++ b/yazi-fs/src/mounts/partition.rs @@ -14,9 +14,11 @@ pub struct Partition { } impl Partition { + // Match mount types that do not reliably emit change notifications, or update directory + // metadata on changes, and should be refreshed frequently / heuristically. pub fn heuristic(&self) -> bool { let b: &[u8] = self.fstype.as_ref().map_or(b"", |s| s.as_encoded_bytes()); - !matches!(b, b"exfat" | b"fuse.rclone") + matches!(b, b"exfat" | b"fuse.rclone") } #[rustfmt::skip] diff --git a/yazi-vfs/src/files.rs b/yazi-vfs/src/files.rs index ed57afdf..7440888d 100644 --- a/yazi-vfs/src/files.rs +++ b/yazi-vfs/src/files.rs @@ -70,7 +70,7 @@ impl VfsFiles for Files { use std::io::ErrorKind; match Cha::from_url(dir).await { Ok(c) if !c.is_dir() => FilesOp::issue_error(dir, ErrorKind::NotADirectory).await, - Ok(c) if c.hits(cha) && PARTITIONS.read().heuristic(cha) => {} + Ok(c) if c.hits(cha) && !PARTITIONS.read().heuristic(cha) => {} Ok(c) => return Some(c), Err(e) => FilesOp::issue_error(dir, e).await, }