diff --git a/common.py b/common.py index 67b419c..985debc 100644 --- a/common.py +++ b/common.py @@ -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