Skip to content

Commit

Permalink
Inherit file/folder_exclude_patterns from global settings
Browse files Browse the repository at this point in the history
Uses `folder_exclude_patterns` and `file_exclude_patterns` patterns to match against directories and files respectively, and not include them in the index.

fixes aziz#82
  • Loading branch information
laggingreflex committed Jul 1, 2016
1 parent a28e4e5 commit 8404ade
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions common.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,13 @@ def prepare_filelist(self, names, path, goto, indent):
for name in names:
full_name = join(path, goto, name)
if isdir(full_name):
index_dirs.append(u'%s%s' % (full_name, os.sep))
items.append(''.join([level, u"▸ ", name, os.sep]))
if not any(fnmatch.fnmatch(name, exclude_pattern) for exclude_pattern in self.view.settings().get('folder_exclude_patterns')):
index_dirs.append(u'%s%s' % (full_name, os.sep))
items.append(''.join([level, u"▸ ", name, os.sep]))
else:
index_files.append(full_name)
files.append(''.join([level, u"≡ ", name]))
if not any(fnmatch.fnmatch(name, exclude_pattern) for exclude_pattern in self.view.settings().get('file_exclude_patterns')):
index_files.append(full_name)
files.append(''.join([level, u"≡ ", name]))
index = index_dirs + index_files
self.index = self.index[:self.number_line] + index + self.index[self.number_line:]
items += files
Expand Down

0 comments on commit 8404ade

Please sign in to comment.