diff options
author | nfnty <git@nfnty.se> | 2017-02-03 22:25:55 +0100 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2017-02-03 22:27:45 +0100 |
commit | f9a5a4b6189d5e04bf429bdab8ce7369b889c9f5 (patch) | |
tree | d305ce3feee41f0cd033d3a49a917d02b75fa7af /ranger | |
parent | 9fd9096d5ed985d7912e7e0ab0425e0fb6badaef (diff) | |
download | ranger-f9a5a4b6189d5e04bf429bdab8ce7369b889c9f5.tar.gz |
Fix hidden filter for flat: Match all path components
Fixes #790
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/container/directory.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ranger/container/directory.py b/ranger/container/directory.py index c6dba2ef..8c94ebe6 100644 --- a/ranger/container/directory.py +++ b/ranger/container/directory.py @@ -233,8 +233,13 @@ class Directory( # pylint: disable=too-many-instance-attributes,too-many-public if not self.settings.show_hidden and self.settings.hidden_filter: hidden_filter = re.compile(self.settings.hidden_filter) hidden_filter_search = hidden_filter.search - filters.append( - lambda fobj: not hidden_filter_search(fobj.relative_path.split(os.path.sep)[0])) + + def hidden_filter_func(fobj): + for comp in fobj.relative_path.split(os.path.sep): + if hidden_filter_search(comp): + return False + return True + filters.append(hidden_filter_func) if self.filter: filter_search = self.filter.search filters.append(lambda fobj: filter_search(fobj.basename)) |