-
Notifications
You must be signed in to change notification settings - Fork 46
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
Inherit file/folder_exclude_patterns from global settings #121
base: master
Are you sure you want to change the base?
Conversation
8404ade
to
55777d5
Compare
Thanks for effort Please rename setting to The checks should be probably moved to Instead of |
8e80529
to
6b8365e
Compare
except: | ||
pass | ||
if not show_excluded: | ||
tests = self.view.settings().get('folder_exclude_patterns', []) + self.view.settings().get('file_exclude_patterns', []) |
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.
Yea, you see the problem is that mixes folders and files which is wrong because folder pattern may match files which are not supposed to be excluded and vice versa.
So then we have to check if name isdir twice, which seems lame.
I dunno, maybe add new method which would check if hidden and add os.sep for folders then call this method instead of items = [name for name in os.listdir(path) if not self.is_hidden(name, path)]
in appropriate places;
that way we would check for isdir once and call is_hidden
with additional argument isdir=True/False
.
What your thoughts are?
Also, the check for attribute on Windows must be the last one, because it is the heaviest so we should not execute it if name was already defined as hidden by other check.
486ca12
to
08ccf88
Compare
08ccf88
to
ea2798a
Compare
|
||
def listdir_only_dirs(self, path): | ||
return [item for item in self.listdir(path) if item["isdir"] == True] | ||
|
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.
These methods now return the directory list.
They are the only ones now that do isdir
check so no other methods need to.
Exclude file|folder_exclude_patterns
If
dired_show_excluded_files
is set tofalse
, it hides files and folders that match againstfolder_exclude_patterns
andfile_exclude_patterns
patterns defined in the global settings.fixes #82