diff options
-rw-r--r-- | ranger/core/actions.py | 2 | ||||
-rw-r--r-- | ranger/gui/widgets/pager.py | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 75f85baf..473701cb 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -620,6 +620,8 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): if self.env.cf.realpath == path: 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)) def on_destroy(signal): try: del self.previews[path] diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py index 196db499..bff30c55 100644 --- a/ranger/gui/widgets/pager.py +++ b/ranger/gui/widgets/pager.py @@ -169,19 +169,18 @@ class Pager(Widget): if isinstance(source, str): self.source_is_stream = False - self.markup = 'ansi' self.lines = source.splitlines() elif hasattr(source, '__getitem__'): self.source_is_stream = False self.lines = source elif hasattr(source, 'readline'): self.source_is_stream = True - self.markup = 'ansi' self.lines = [] else: self.source = None self.source_is_stream = False return False + self.markup = 'ansi' if not self.source_is_stream and strip: self.lines = map(lambda x: x.strip(), self.lines) |