Repository: helix-editor/helix
File: helix-term/src/ui/mod.rs (Rust)

Code before:
                    {
                        Ok(regex) => {
                            let (view, doc) = current!(cx.editor);

                            // revert state to what it was before the last update
                            doc.set_selection(view.id, snapshot.clone());

                            fun(view, doc, regex, event);

                            view.ensure_cursor_in_view(doc, cx.editor.config.scrolloff);
                        }
                        Err(_err) => (), // TODO: mark command line as error
                    }
                }
            }
        },
    )
}

pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePicker<PathBuf> {
    use ignore::{types::TypesBuilder, WalkBuilder};
    use std::time;

    // We want to exclude files that the editor can't handle yet
    let mut type_builder = TypesBuilder::new();
    let mut walk_builder = WalkBuilder::new(&root);
    walk_builder.git_ignore(config.hide_gitignore);
    let walk_builder = match type_builder.add(
        "compressed",
        "*.{zip,gz,bz2,zst,lzo,sz,tgz,tbz2,lz,lz4,lzma,lzo,z,Z,xz,7z,rar,cab}",
    ) {
        Err(_) => &walk_builder,
        _ => {
            type_builder.negate("all");
            let excluded_types = type_builder.build().unwrap();
            walk_builder.types(excluded_types)
        }
    };

    let files = walk_builder.build().filter_map(|entry| {
        let entry = entry.ok()?;
        // Path::is_dir() traverses symlinks, so we use it over DirEntry::is_dir
        if entry.path().is_dir() {
            // Will give a false positive if metadata cannot be read (eg. permission error)
            return None;
        }

        let time = entry.metadata().map_or(time::UNIX_EPOCH, |metadata| {
            metadata
                .accessed()
                .or_else(|_| metadata.modified())

Review comment (suggestion):
There's another `WalkBuilder` in commands.rs used for global search, we should pass this option there too.

Code after:
                    {
                        Ok(regex) => {
                            let (view, doc) = current!(cx.editor);

                            // revert state to what it was before the last update
                            doc.set_selection(view.id, snapshot.clone());

                            fun(view, doc, regex, event);

                            view.ensure_cursor_in_view(doc, cx.editor.config.scrolloff);
                        }
                        Err(_err) => (), // TODO: mark command line as error
                    }
                }
            }
        },
    )
}

pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePicker<PathBuf> {
    use ignore::{types::TypesBuilder, WalkBuilder};
    use std::time;

    // We want to exclude files that the editor can't handle yet
    let mut type_builder = TypesBuilder::new();
    let mut walk_builder = WalkBuilder::new(&root);
    walk_builder
        .hidden(config.file_picker.hidden)
        .parents(config.file_picker.parents)
        .ignore(config.file_picker.ignore)
        .git_ignore(config.file_picker.git_ignore)
        .git_global(config.file_picker.git_global)
        .git_exclude(config.file_picker.git_exclude)
        .max_depth(config.file_picker.max_depth);

    let walk_builder = match type_builder.add(
        "compressed",
        "*.{zip,gz,bz2,zst,lzo,sz,tgz,tbz2,lz,lz4,lzma,lzo,z,Z,xz,7z,rar,cab}",
    ) {
        Err(_) => &walk_builder,
        _ => {
            type_builder.negate("all");
            let excluded_types = type_builder.build().unwrap();
            walk_builder.types(excluded_types)
        }
    };

    let files = walk_builder.build().filter_map(|entry| {
        let entry = entry.ok()?;
        // Path::is_dir() traverses symlinks, so we use it over DirEntry::is_dir
        if entry.path().is_dir() {