@@ -345,7 +345,15 @@ pub mod completers {
347 pub fn filename(editor: &Editor, input: &str) -> Vec<Completion> {
347 pub fn filename(editor: &Editor, input: &str) -> Vec<Completion> {
348+ filename_with_git_ignore(editor, input, true)
351+ pub fn filename_with_git_ignore(
355+ ) -> Vec<Completion> {
348− filename_impl(editor, input, |entry| {
356+ filename_impl(editor, input, git_ignore, |entry| {
349 let is_dir = entry.file_type().map_or(false, |entry| entry.is_dir());
357 let is_dir = entry.file_type().map_or(false, |entry| entry.is_dir());
351 if is_dir {
359 if is_dir {
@@ -416,7 +424,15 @@ pub mod completers {
418 pub fn directory(editor: &Editor, input: &str) -> Vec<Completion> {
426 pub fn directory(editor: &Editor, input: &str) -> Vec<Completion> {
427+ directory_with_git_ignore(editor, input, true)
430+ pub fn directory_with_git_ignore(
434+ ) -> Vec<Completion> {
419− filename_impl(editor, input, |entry| {
435+ filename_impl(editor, input, git_ignore, |entry| {
420 let is_dir = entry.file_type().map_or(false, |entry| entry.is_dir());
436 let is_dir = entry.file_type().map_or(false, |entry| entry.is_dir());
422 if is_dir {
438 if is_dir {
@@ -439,7 +455,12 @@ pub mod completers {
441 // TODO: we could return an iter/lazy thing so it can fetch as many as it needs.
457 // TODO: we could return an iter/lazy thing so it can fetch as many as it needs.
442− fn filename_impl<F>(_editor: &Editor, input: &str, filter_fn: F) -> Vec<Completion>
458+ fn filename_impl<F>(
463+ ) -> Vec<Completion>
444 F: Fn(&ignore::DirEntry) -> FileMatch,
465 F: Fn(&ignore::DirEntry) -> FileMatch,
@@ -482,6 +503,7 @@ pub mod completers {
482 let mut files: Vec<_> = WalkBuilder::new(&dir)
503 let mut files: Vec<_> = WalkBuilder::new(&dir)
483 .hidden(false)
504 .hidden(false)
484 .follow_links(false) // We're scanning over depth 1
505 .follow_links(false) // We're scanning over depth 1
506+ .git_ignore(git_ignore)
485 .max_depth(Some(1))
507 .max_depth(Some(1))
487 .filter_map(|file| {
509 .filter_map(|file| {