This commit is contained in:
Kirawi 2025-04-01 17:37:23 +02:00 committed by GitHub
commit 10904e7dc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 0 deletions

View file

@ -2524,6 +2524,7 @@ fn global_search(cx: &mut Context) {
.parents(config.file_picker_config.parents)
.ignore(config.file_picker_config.ignore)
.follow_links(config.file_picker_config.follow_symlinks)
.require_git(config.file_picker_config.require_git)
.git_ignore(config.file_picker_config.git_ignore)
.git_global(config.file_picker_config.git_global)
.git_exclude(config.file_picker_config.git_exclude)

View file

@ -213,6 +213,7 @@ pub fn file_picker(editor: &Editor, root: PathBuf) -> FilePicker {
.parents(config.file_picker.parents)
.ignore(config.file_picker.ignore)
.follow_links(config.file_picker.follow_symlinks)
.require_git(config.file_picker.require_git)
.git_ignore(config.file_picker.git_ignore)
.git_global(config.file_picker.git_global)
.git_exclude(config.file_picker.git_exclude)
@ -597,10 +598,12 @@ pub mod completers {
};
let end = input.len()..;
let require_git = editor.config().file_picker.require_git;
let files = WalkBuilder::new(&dir)
.hidden(false)
.follow_links(false) // We're scanning over depth 1
.require_git(require_git)
.git_ignore(git_ignore)
.max_depth(Some(1))
.build()

View file

@ -189,6 +189,9 @@ pub struct FilePickerConfig {
/// Enables reading `.ignore` files.
/// Whether to hide files listed in .ignore in file picker and global search results. Defaults to true.
pub ignore: bool,
/// Enables `git_*` features only if a `.git` directory is present
/// Defaults to true
pub require_git: bool,
/// Enables reading `.gitignore` files.
/// Whether to hide files listed in .gitignore in file picker and global search results. Defaults to true.
pub git_ignore: bool,
@ -211,6 +214,7 @@ impl Default for FilePickerConfig {
deduplicate_links: true,
parents: true,
ignore: true,
require_git: true,
git_ignore: true,
git_global: true,
git_exclude: true,