Skip to content

Commit 6107a47

Browse files
committed
Reformat
1 parent 912b361 commit 6107a47

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

yazi-actor/src/mgr/ignore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl Actor for Ignore {
2828
} else {
2929
cwd.as_path().map(|p| p.display().to_string()).unwrap_or_default()
3030
};
31-
31+
3232
let exclude_patterns = YAZI.files.excludes_for_context(&cwd_str);
3333

3434
// Create glob matcher function for compiled patterns

yazi-config/src/files/exclude.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,12 @@ impl Exclude {
107107
return true;
108108
}
109109

110-
// Check if path contains the pattern anywhere (for relative patterns like "/target/**")
111-
// This allows "/target/**" to match "/home/user/project/target/debug"
110+
// Check if path contains the pattern anywhere (for relative patterns like
111+
// "/target/**") This allows "/target/**" to match
112+
// "/home/user/project/target/debug"
112113
if prefix.starts_with('/') && !prefix.starts_with("//") {
113-
// Single leading slash means relative pattern - check if path contains this segment
114+
// Single leading slash means relative pattern - check if path contains this
115+
// segment
114116
let pattern = &prefix[1..]; // Remove leading slash
115117
if path.contains(&format!("/{}/", pattern)) || path.ends_with(&format!("/{}", pattern)) {
116118
return true;

yazi-fs/src/ignore.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ use yazi_shared::url::AsUrl;
1212
#[derive(Clone)]
1313
pub struct IgnoreFilter {
1414
/// Set of paths ignored by git (from git status)
15-
ignored_paths: HashSet<PathBuf>,
15+
ignored_paths: HashSet<PathBuf>,
1616
/// Custom gitignore matcher for exclude patterns
17-
gitignore: Option<ignore::gitignore::Gitignore>,
17+
gitignore: Option<ignore::gitignore::Gitignore>,
1818
/// Custom glob-based matcher function for advanced pattern matching
19-
/// Returns Some(true) if should be ignored, Some(false) if whitelisted, None if no match
20-
glob_matcher: Option<Arc<dyn Fn(&Path) -> Option<bool> + Send + Sync>>,
19+
/// Returns Some(true) if should be ignored, Some(false) if whitelisted, None
20+
/// if no match
21+
glob_matcher: Option<Arc<dyn Fn(&Path) -> Option<bool> + Send + Sync>>,
2122
}
2223

2324
impl std::fmt::Debug for IgnoreFilter {
@@ -114,8 +115,8 @@ impl IgnoreFilter {
114115
if ignored_paths.is_empty()
115116
|| (ignored_paths.len() == 1 && ignored_paths.contains(&workdir.join(".git")))
116117
{
117-
// If we have no git-ignored paths but we have exclude patterns or glob matcher, still create
118-
// the filter
118+
// If we have no git-ignored paths but we have exclude patterns or glob matcher,
119+
// still create the filter
119120
if gitignore.is_some() || glob_matcher.is_some() {
120121
return Some(Self { ignored_paths, gitignore, glob_matcher });
121122
}

0 commit comments

Comments
 (0)