diff options
author | Vitaly Belman <vitaly@telefonica.com> | 2016-03-06 00:30:09 +0200 |
---|---|---|
committer | Vitaly Belman <vitaly@telefonica.com> | 2016-03-06 00:30:09 +0200 |
commit | 7ee4b45bd2619fb07c9b139940003224bedb1de3 (patch) | |
tree | fb3614888422e1df598332ee9631c9024ecb661d /ranger | |
parent | 9c585e48e14525f11d2405ea0bb9b5eba92e63e9 (diff) | |
download | ranger-7ee4b45bd2619fb07c9b139940003224bedb1de3.tar.gz |
adding ability to clear folder filter upon navigating from it. optional and false by default.
Diffstat (limited to 'ranger')
-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 |