about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-03-24 14:56:00 +0100
committerhut <hut@lavabit.com>2013-03-24 14:56:00 +0100
commit36a8688271953fdfffb5bd0bae967cde0b675b05 (patch)
tree02bf136a6f60296901107ad62421680e2f6ad3b8
parent8215f3af6a18755165e105879eeaad4fcad9951d (diff)
downloadranger-36a8688271953fdfffb5bd0bae967cde0b675b05.tar.gz
container.directory: fix pointer in refilter, not in sort
-rw-r--r--ranger/container/directory.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/ranger/container/directory.py b/ranger/container/directory.py
index 4b3267c6..21234186 100644
--- a/ranger/container/directory.py
+++ b/ranger/container/directory.py
@@ -174,8 +174,10 @@ class Directory(FileSystemObject, Accumulator, Loadable):
             hidden_filter = re.compile(self.settings.hidden_filter)
         else:
             hidden_filter = None
+
         self.files = [f for f in self.files_all if accept_file(
             f.basename, self, hidden_filter, self.filter)]
+        self.move_to_obj(self.pointed_obj)
 
     # XXX: Check for possible race conditions
     def load_bit_by_bit(self):
@@ -343,7 +345,6 @@ class Directory(FileSystemObject, Accumulator, Loadable):
         if self.files_all is None:
             return
 
-        old_pointed_obj = self.pointed_obj
         try:
             sort_func = self.sort_dict[self.settings.sort]
         except:
@@ -367,11 +368,6 @@ class Directory(FileSystemObject, Accumulator, Loadable):
 
         self.refilter()
 
-        if self.pointer is not None:
-            self.move_to_obj(old_pointed_obj)
-        else:
-            self.correct_pointer()
-
     def _get_cumulative_size(self):
         if self.size == 0:
             return 0