diff options
-rw-r--r-- | ranger/config/rc.conf | 3 | ||||
-rw-r--r-- | ranger/container/settings.py | 1 | ||||
-rw-r--r-- | ranger/core/tab.py | 5 |
3 files changed, 9 insertions, 0 deletions
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index 3b8ee333..43a9b99a 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -191,6 +191,9 @@ set idle_delay 2000 # check all directories above the current one as well? set metadata_deep_search false +# Clear all existing filters when leaving a directory +set clear_filters_on_dir_change false + # =================================================================== # == Local Options # =================================================================== diff --git a/ranger/container/settings.py b/ranger/container/settings.py index db8ca45c..d7258d6d 100644 --- a/ranger/container/settings.py +++ b/ranger/container/settings.py @@ -62,6 +62,7 @@ ALLOWED_SETTINGS = { 'vcs_backend_hg': str, 'vcs_backend_svn': str, 'xterm_alt_key': bool, + 'clear_filters_on_dir_change': bool } DEFAULT_VALUES = { diff --git a/ranger/core/tab.py b/ranger/core/tab.py index 8e483e7d..f8de953f 100644 --- a/ranger/core/tab.py +++ b/ranger/core/tab.py @@ -108,6 +108,11 @@ class Tab(FileManagerAware, SettingsAware): if path is None: return path = str(path) + # clear filter in the folder we're leaving + if self.fm.settings.clear_filters_on_dir_change and self.thisdir: + self.thisdir.filter = None + self.thisdir.refilter() + previous = self.thisdir # get the absolute path |