on master help sign in
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.

commit700058f433d0d12b30b968d50cd7f9b93f983107 authorDaniel S Poulin <dan.poulin@digitalsurgeons.com> dateSun 20 Feb 2022, 01:47 (5 years ago) parentc7b326b
1 file changed+5−1
helix-term/src/ui/mod.rs+5−1
helix-term/src/ui/mod.rs+5−1
@@ -111,7 +111,11 @@ pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePi
111111 .git_ignore(config.file_picker.git_ignore)
112112 .git_global(config.file_picker.git_global)
113113 .git_exclude(config.file_picker.git_exclude)
114− .max_depth(config.file_picker.max_depth);
114+ .max_depth(config.file_picker.max_depth)
115+ // We always want to ignore the .git directory, otherwise if
116+ // `ignore` is turned off above, we end up with a lot of noise
117+ // in our picker.
118+ .filter_entry(|entry| entry.file_name() != ".git");
115119
116120 let walk_builder = match type_builder.add(
117121 "compressed",