aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorDaniel S Poulin2022-02-20 06:47:43 +0000
committerGitHub2022-02-20 06:47:43 +0000
commit700058f433d0d12b30b968d50cd7f9b93f983107 (patch)
treef77814725ec58741e6ff2d749f41e468e379f52f /helix-term
parentc7b326be047a42f6a58146b0de049d48568e397f (diff)
Always ignore the .git directory in file picker (#1604)
Some users (including myself) want to turn off filtering of files prefixed with `.`, as they are often useful to edit. For example, `.env` files, configuration for linters `.eslint.json` and the like.
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/ui/mod.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs
index 21c1f7aa..94b930a0 100644
--- a/helix-term/src/ui/mod.rs
+++ b/helix-term/src/ui/mod.rs
@@ -111,7 +111,11 @@ pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePi
.git_ignore(config.file_picker.git_ignore)
.git_global(config.file_picker.git_global)
.git_exclude(config.file_picker.git_exclude)
- .max_depth(config.file_picker.max_depth);
+ .max_depth(config.file_picker.max_depth)
+ // We always want to ignore the .git directory, otherwise if
+ // `ignore` is turned off above, we end up with a lot of noise
+ // in our picker.
+ .filter_entry(|entry| entry.file_name() != ".git");
let walk_builder = match type_builder.add(
"compressed",