aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/finder/plugin/searcher/file/name.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/finder/plugin/searcher/file/name.py b/packages/finder/plugin/searcher/file/name.py
index 4f4bd18..b1ae939 100644
--- a/packages/finder/plugin/searcher/file/name.py
+++ b/packages/finder/plugin/searcher/file/name.py
@@ -24,14 +24,19 @@ import re
class FinderPluginFileNameSearcher():
def __init__(self, path):
self.set_path(path)
- self.items = []
def set_path(self, path):
- self.path = path
- self.items = []
+ # Initialize item list
+ if 'items' not in dir(self):
+ self.items = []
+
+ # Reset item list when changing paths
+ elif 'path' in dir(self) and self.path != path:
+ self.items = []
+
+ self.path = path
async def finder(self):
- path = self.path
ignore_folders = [ '.git', '__pycache__' ]
ignore_files = [ '.gitignore', '.gitattributes', '.gitmodules' ]