Skip to content

Commit 224c041

Browse files
Philipp-Mpathwave
authored andcommitted
Use the same WalkBuilder configuration for the global search file picker as the default file picker (helix-editor#4334)
Skip searching .git in global search, similar to how file picker skips listing files in .git.
1 parent c5a06df commit 224c041

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

helix-term/src/commands.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,10 +1872,15 @@ fn global_search(cx: &mut Context) {
18721872
.hidden(file_picker_config.hidden)
18731873
.parents(file_picker_config.parents)
18741874
.ignore(file_picker_config.ignore)
1875+
.follow_links(file_picker_config.follow_symlinks)
18751876
.git_ignore(file_picker_config.git_ignore)
18761877
.git_global(file_picker_config.git_global)
18771878
.git_exclude(file_picker_config.git_exclude)
18781879
.max_depth(file_picker_config.max_depth)
1880+
// We always want to ignore the .git directory, otherwise if
1881+
// `ignore` is turned off above, we end up with a lot of noise
1882+
// in our picker.
1883+
.filter_entry(|entry| entry.file_name() != ".git")
18791884
.build_parallel()
18801885
.run(|| {
18811886
let mut searcher = searcher.clone();

0 commit comments

Comments
 (0)