From 3f7ec86145a15dc84cad7457a67accc184268be4 Mon Sep 17 00:00:00 2001 From: chriszarate Date: Wed, 15 May 2024 22:45:38 -0400 Subject: [PATCH] Remove `ignore` options from `rg` and `fd` When `yazi`'s `hidden` option is true, it passes `--no-ignore` to `fd` and `rg`. However, ignore files have no actual relation to hidden files. They often contain entries like `node_modules` or `vendor` that users want to ignore in all situations. --- yazi-plugin/src/external/fd.rs | 2 +- yazi-plugin/src/external/rg.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yazi-plugin/src/external/fd.rs b/yazi-plugin/src/external/fd.rs index 30c4261e..8ba6c3ec 100644 --- a/yazi-plugin/src/external/fd.rs +++ b/yazi-plugin/src/external/fd.rs @@ -16,7 +16,7 @@ pub fn fd(opt: FdOpt) -> Result> { .arg("--base-directory") .arg(&opt.cwd) .arg("--regex") - .args(if opt.hidden { ["--hidden", "--no-ignore"] } else { ["--no-hidden", "--ignore"] }) + .args(if opt.hidden { ["--hidden"] } else { ["--no-hidden"] }) .args(opt.args) .arg(opt.subject) .kill_on_drop(true) diff --git a/yazi-plugin/src/external/rg.rs b/yazi-plugin/src/external/rg.rs index d5b4b63c..2763fd4b 100644 --- a/yazi-plugin/src/external/rg.rs +++ b/yazi-plugin/src/external/rg.rs @@ -15,7 +15,7 @@ pub fn rg(opt: RgOpt) -> Result> { let mut child = Command::new("rg") .current_dir(&opt.cwd) .args(["--color=never", "--files-with-matches", "--smart-case"]) - .args(if opt.hidden { ["--hidden", "--no-ignore"] } else { ["--no-hidden", "--ignore"] }) + .args(if opt.hidden { ["--hidden"] } else { ["--no-hidden"] }) .args(opt.args) .arg(opt.subject) .kill_on_drop(true)