summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-12-21 23:29:42 +0100
committerhut <hut@lavabit.com>2010-12-21 23:32:10 +0100
commitd3124d6b67514e48107cc6c0dd0a92d5a33ace8b (patch)
tree7732afdd51c29bae01ce2e8c5d0aebe945c0062d
parentd7fa37ed92be945f33cc071522d6c88712e04d92 (diff)
downloadranger-d3124d6b67514e48107cc6c0dd0a92d5a33ace8b.tar.gz
core.actions: Don't attempt do show directory in pager (key i)
-rw-r--r--ranger/core/actions.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 473701cb..d5f740a3 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -562,6 +562,8 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 	def display_file(self):
 		if not hasattr(self.ui, 'open_embedded_pager'):
 			return
+		if not self.env.cf or not self.env.cf.is_file:
+			return
 
 		pager = self.ui.open_embedded_pager()
 		pager.set_source(self.env.cf.get_preview_source(pager.wid, pager.hei))
@@ -621,7 +623,9 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 						self.ui.browser.need_redraw = True
 					data['loading'] = False
 					pager = self.ui.browser.pager
-					pager.set_source(self.env.cf.get_preview_source(pager.wid, pager.hei))
+					if self.env.cf and self.env.cf.is_file:
+						pager.set_source(self.env.cf.get_preview_source(
+							pager.wid, pager.hei))
 				def on_destroy(signal):
 					try:
 						del self.previews[path]