-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File picker config #988
File picker config #988
Changes from all commits
d686c8e
1f69124
e049182
07955f9
45c131c
339325f
69e9bc8
0740957
5fd9dca
4d1f0fa
8d8aa14
770e31e
c706744
5cfb86f
80ba0e0
5e07a6b
3b381df
92664a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,13 +93,22 @@ pub fn regex_prompt( | |
) | ||
} | ||
|
||
pub fn file_picker(root: PathBuf) -> FilePicker<PathBuf> { | ||
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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's another There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, thank you for review, I will look into this! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In commit 339325f I added a variable to allow for passing into The remaining changes were all due to formatting, using Helix with rust-analyser. |
||
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}", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can probably be simplified, but probably needs reformatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not believe I changed this logic in the course of this PR--the formatting changed due to the addition of the fluent-style calls above (lines 1392-1398).
Here are the same lines in master.