Inherit file/folder_exclude_patterns from global settings#121
Inherit file/folder_exclude_patterns from global settings#121laggingreflex wants to merge 1 commit intoaziz:masterfrom
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
common.py
Outdated
| 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.
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.
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_filesis set tofalse, it hides files and folders that match againstfolder_exclude_patternsandfile_exclude_patternspatterns defined in the global settings.fixes #82