From 205f4e2148b6a93a7aa9b8c1978f746e800b726c Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Sun, 21 May 2023 20:54:10 +0200 Subject: [PATCH] fix bug #34 --- catcli/noder.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/catcli/noder.py b/catcli/noder.py index c81dae0..b53e7ee 100644 --- a/catcli/noder.py +++ b/catcli/noder.py @@ -582,8 +582,7 @@ class Noder: start = self.get_node(top, startnode) filterfunc = self._callback_find_name(key, only_dir) found = anytree.findall(start, filter_=filterfunc) - nbfound = len(found) - self._debug(f'found {nbfound} node(s)') + self._debug(f'found {len(found)} node(s)') # compile found nodes paths = {} @@ -591,10 +590,14 @@ class Noder: item.name = fix_badchars(item.name) if hasattr(item, 'relpath'): item.relpath = fix_badchars(item.relpath) + storage = self._get_storage(item) if parentfromtree: - paths[self._get_parents(item)] = item + parent = self._get_parents(item) + key = f'{storage}/{parent}/{item.relpath}' + paths[parent] = item else: - paths[item.relpath] = item + key = f'{storage}/{item.path}' + paths[key] = item # handle fzf mode if fmt.startswith('fzf'):