about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/gui/widgets/browsercolumn.py2
-rw-r--r--ranger/gui/widgets/browserview.py8
2 files changed, 8 insertions, 2 deletions
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py
index c0d22658..5422b960 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -113,8 +113,6 @@ class BrowserColumn(Pager):
 	def poke(self):
 		Widget.poke(self)
 		self.target = self.env.at_level(self.level)
-		if self.target and self.target.is_file and self.has_preview():
-			self.visible = True
 
 	def draw(self):
 		"""Call either _draw_file() or _draw_directory()"""
diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py
index 54fc28f2..2be3ca92 100644
--- a/ranger/gui/widgets/browserview.py
+++ b/ranger/gui/widgets/browserview.py
@@ -289,5 +289,13 @@ class BrowserView(Widget, DisplayableContainer):
 
 	def poke(self):
 		DisplayableContainer.poke(self)
+
+		# Show the preview column when it has a preview but has
+		# been hidden (e.g. because of padding_right = False)
+		if not self.pager.visible and not self.columns[-1].visible and \
+		self.columns[-1].target and self.columns[-1].target.is_directory \
+		or self.columns[-1].has_preview():
+			self.columns[-1].visible = True
+
 		if self.preview and self.is_collapsed != self._collapse():
 			self.resize(self.y, self.x, self.hei, self.wid)