summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-06-19 20:38:32 +0200
committerhut <hut@lepus.uberspace.de>2015-06-19 20:38:32 +0200
commitdb7c728b71bce950b4683dca16d85fbc55bd2c42 (patch)
tree62640415650550119172f384ac363207293d87dd
parent4da0355a0e1d7bdc58a4df03409c142c5a0a6b88 (diff)
parent9480940bbfd2a7631d358bc0dd8d2f32dc0b7714 (diff)
downloadranger-db7c728b71bce950b4683dca16d85fbc55bd2c42.tar.gz
Merge branch 'hidden-files-selection' of https://github.com/ajtluser/ranger
-rw-r--r--ranger/container/directory.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ranger/container/directory.py b/ranger/container/directory.py
index b851eece..52b494d5 100644
--- a/ranger/container/directory.py
+++ b/ranger/container/directory.py
@@ -229,6 +229,15 @@ class Directory(FileSystemObject, Accumulator, Loadable):
             filters.append(lambda file: temporary_filter_search(file.basename))
 
         self.files = [f for f in self.files_all if accept_file(f, filters)]
+        
+        # A fix for corner cases when the user invokes show_hidden on a
+        # directory that contains only hidden directories and hidden files.
+        if self.files and not self.pointed_obj:
+            self.pointed_obj = self.files[0]
+        elif not self.files:
+            self.content_loaded = False
+            self.pointed_obj = None
+
         self.move_to_obj(self.pointed_obj)
 
     # XXX: Check for possible race conditions