-
Notifications
You must be signed in to change notification settings - Fork 458
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
feat: hide specified files and dirs #2089
base: main
Are you sure you want to change the base?
Conversation
@sxyazi Hi! Thanks for your awesome work on this awesome file manager! Wanted to push this feature a little bit more here haha, recently I'm switching my primary file manager from |
@TobisLee This feature should not be implemented in You need to implement it in Line 20 in 00e8adc
Then, pass it from the outside, just like what the Line 360 in 00e8adc
|
Hey, @sxyazi , I implement |
Where these comments are? I didn't see them |
@@ -24,7 +24,7 @@ impl Default for Folder { | |||
Self { | |||
url: Default::default(), | |||
cha: Default::default(), | |||
files: Files::new(MANAGER.show_hidden), | |||
files: Files::new(MANAGER.show_hidden, Filter::new(MANAGER.ignore_rule.as_str(), yazi_fs::FilterCase::Smart).ok()), |
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.
Is there a better place to initialize ignore_filter?
@@ -321,6 +322,13 @@ impl Files { | |||
} | |||
|
|||
fn split_files(&self, files: impl IntoIterator<Item = File>) -> (Vec<File>, Vec<File>) { | |||
let mut files: Vec<File> = files.into_iter().collect(); | |||
if let Some(ignore_filter) = &self.ignore_filter { |
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 if condition will be called lots of times, I think it just should be called when hover a dir? Should it be put in set_ignore_filter
or other place?
I submit the review, the comments should be seen now. |
Hey, @sxyazi , can you review this code plz? |
Try to fix #694.
Works with the given regex string:
https://github.com/TobisLee/yazi/blob/2fdd7b6f554dd4e15648ed8f611bd83cedd511c8/yazi-shared/src/url/urn.rs#L22
but failed with hidden_rule config:
https://github.com/TobisLee/yazi/blob/2fdd7b6f554dd4e15648ed8f611bd83cedd511c8/yazi-shared/src/url/urn.rs#L23
Cargo shows