From d3124d6b67514e48107cc6c0dd0a92d5a33ace8b Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 21 Dec 2010 23:29:42 +0100 Subject: core.actions: Don't attempt do show directory in pager (key i) --- ranger/core/actions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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] -- cgit 1.4.1-2-gfad0