on master help sign in
Use the same `WalkBuilder` configuration for the global search file picker as the default file picker (#4334)

Skip searching .git in global search, similar to how file picker skips listing files in .git.

commitd17ffc47f008821e1b4ab04cd85d019ed8dc6fb9 authorPhilipp Mildenberger <philipp@mildenberger.me> dateTue 18 Oct 2022, 19:28 (4 years ago) parentfee5db1
1 file changed+5
helix-term/src/commands.rs+5
helix-term/src/commands.rs+5
@@ -1865,10 +1865,15 @@ fn global_search(cx: &mut Context) {
18651865 .hidden(file_picker_config.hidden)
18661866 .parents(file_picker_config.parents)
18671867 .ignore(file_picker_config.ignore)
1868+ .follow_links(file_picker_config.follow_symlinks)
18681869 .git_ignore(file_picker_config.git_ignore)
18691870 .git_global(file_picker_config.git_global)
18701871 .git_exclude(file_picker_config.git_exclude)
18711872 .max_depth(file_picker_config.max_depth)
1873+ // We always want to ignore the .git directory, otherwise if
1874+ // `ignore` is turned off above, we end up with a lot of noise
1875+ // in our picker.
1876+ .filter_entry(|entry| entry.file_name() != ".git")
18721877 .build_parallel()
18731878 .run(|| {
18741879 let mut searcher = searcher.clone();