diff options
author | hut <hut@lavabit.com> | 2013-02-15 18:34:44 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2013-02-15 18:34:57 +0100 |
commit | a471b6e1a778112c857a10093c6ccf16070ed1e2 (patch) | |
tree | 2cde9a27bf2588374d996aa466d244deac58b191 | |
parent | 9b065d0ac7ea3a26f73146b33e087e1ad35980f3 (diff) | |
download | ranger-a471b6e1a778112c857a10093c6ccf16070ed1e2.tar.gz |
fsobject.directory: check for temporary_filter
this can be used in commands which temporarily filter the directory, without disrupting the user-defined filter.
-rw-r--r-- | ranger/fsobject/directory.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py index a71b00a9..0c4f10bd 100644 --- a/ranger/fsobject/directory.py +++ b/ranger/fsobject/directory.py @@ -41,6 +41,8 @@ def accept_file(fname, directory, hidden_filter, name_filter): return False if name_filter and name_filter not in fname: return False + if directory.temporary_filter and not directory.temporary_filter.search(fname): + return False return True class Directory(FileSystemObject, Accumulator, Loadable, SettingsAware): @@ -54,6 +56,7 @@ class Directory(FileSystemObject, Accumulator, Loadable, SettingsAware): filenames = None files = None filter = None + temporary_filter = None marked_items = None scroll_begin = 0 |