This commit is contained in:
sxyazi 2025-08-05 20:40:19 +08:00
parent 3ba13efddc
commit 7bb7a8179f
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View file

@ -8,12 +8,12 @@ use yazi_shared::url::{Scheme, Url};
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(try_from = "String")] #[serde(try_from = "String")]
pub struct Pattern { pub struct Pattern {
inner: globset::GlobMatcher, inner: globset::GlobMatcher,
scheme: PatternScheme, scheme: PatternScheme,
is_dir: bool, pub is_dir: bool,
is_star: bool, is_star: bool,
#[cfg(windows)] #[cfg(windows)]
sep_lit: bool, sep_lit: bool,
} }
impl Pattern { impl Pattern {

View file

@ -122,7 +122,7 @@ fn read_dir(lua: &Lua) -> mlua::Result<Function> {
let mut files = vec![]; let mut files = vec![];
while let Ok(Some(next)) = it.next_entry().await { while let Ok(Some(next)) = it.next_entry().await {
let url = next.url(); let url = next.url();
if pat.as_ref().is_some_and(|p| !p.match_url(&url, false)) { if pat.as_ref().is_some_and(|p| !p.match_url(&url, p.is_dir)) {
continue; continue;
} }