aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-07-24 21:56:12 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-07-24 21:56:12 -0300
commita30f7ed99d1d0fdb09d572c58d585af73d59f46c (patch)
tree965012e879948c605e3e7bbf7cd2fe3414a8158c /packages
parentff5def7abde8a8dca891ed087722c40f2b05a029 (diff)
downloadfinder-a30f7ed99d1d0fdb09d572c58d585af73d59f46c.tar.gz
finder-a30f7ed99d1d0fdb09d572c58d585af73d59f46c.tar.bz2
Fix: plugin: opener: searcher: set_path logic
Diffstat (limited to 'packages')
-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' ]