summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorrandnobx <randynobx@gmail.com>2017-05-20 19:42:45 -0400
committerrandnobx <randynobx@gmail.com>2017-05-20 19:42:45 -0400
commitb27c54d69ab53be0015615a4de364f5b7cdd1574 (patch)
tree622e45d5aa8399da0f86e85a798f937e00ae5ed4 /ranger
parent6ded89ed41799b1244cb0a57dd29c10feb51d537 (diff)
downloadranger-b27c54d69ab53be0015615a4de364f5b7cdd1574.tar.gz
refactor inode_filter assignment; change function name
Diffstat (limited to 'ranger')
-rw-r--r--ranger/container/directory.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/ranger/container/directory.py b/ranger/container/directory.py
index 958c6f28..69b619ea 100644
--- a/ranger/container/directory.py
+++ b/ranger/container/directory.py
@@ -258,12 +258,9 @@ class Directory(  # pylint: disable=too-many-instance-attributes,too-many-public
                 return True
             filters.append(hidden_filter_func)
         if self.settings.global_inode_type_filter or self.inode_type_filter:
-            def hidden_inode_filter_func(obj):
+            def inode_filter_func(obj):
                 # Use local inode_type_filter is present, global otherwise
-                if self.inode_type_filter:
-                    inode_filter = self.inode_type_filter
-                else:
-                    inode_filter = self.settings.global_inode_type_filter
+                inode_filter = self.inode_type_filter or self.settings.global_inode_type_filter
                 # Apply filter
                 if self.FILTER_DIRS in inode_filter and obj.is_directory:
                     return True
@@ -272,7 +269,7 @@ class Directory(  # pylint: disable=too-many-instance-attributes,too-many-public
                 elif self.FILTER_LINKS in inode_filter and obj.is_link:
                     return True
                 return False
-            filters.append(hidden_inode_filter_func)
+            filters.append(inode_filter_func)
         if self.filter:
             filter_search = self.filter.search
             filters.append(lambda fobj: filter_search(fobj.basename))