Skip to content

Commit

Permalink
feat: make filename_impl walker configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmaSd committed Jul 22, 2023
1 parent 505213d commit 37e52b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion helix-term/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ pub mod completers {
}

// TODO: we could return an iter/lazy thing so it can fetch as many as it needs.
fn filename_impl<F>(_editor: &Editor, input: &str, filter_fn: F) -> Vec<Completion>
fn filename_impl<F>(editor: &Editor, input: &str, filter_fn: F) -> Vec<Completion>
where
F: Fn(&ignore::DirEntry) -> FileMatch,
{
Expand Down Expand Up @@ -481,10 +481,14 @@ pub mod completers {

let end = input.len()..;

let config = editor.config();
let mut files: Vec<_> = WalkBuilder::new(&dir)
.hidden(false)
.follow_links(false) // We're scanning over depth 1
.max_depth(Some(1))
.ignore(config.file_picker.ignore)
.git_ignore(config.file_picker.git_ignore)
.git_exclude(config.file_picker.git_exclude)
.build()
.filter_map(|file| {
file.ok().and_then(|entry| {
Expand Down

0 comments on commit 37e52b9

Please sign in to comment.