From a30f7ed99d1d0fdb09d572c58d585af73d59f46c Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 24 Jul 2024 21:56:12 -0300 Subject: Fix: plugin: opener: searcher: set_path logic --- packages/finder/plugin/searcher/file/name.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'packages') 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' ] -- cgit v1.2.3