From 98761094d8e9f43fae4342e44c2bcdc6dea59331 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 14 Sep 2011 15:15:53 +0200 Subject: gui.widgets.pager: fixed crash --- ranger/gui/widgets/pager.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py index 05485189..d1bf5918 100644 --- a/ranger/gui/widgets/pager.py +++ b/ranger/gui/widgets/pager.py @@ -111,12 +111,16 @@ class Pager(Widget): if TITLE_REGEXP.match(line): self.color_at(i, 0, -1, 'title', *baseclr) elif self.markup == 'ansi': - self.win.move(i, 0) - for chunk in ansi.text_with_fg_bg_attr(line): - if isinstance(chunk, tuple): - self.set_fg_bg_attr(*chunk) - else: - self.addstr(chunk) + try: + self.win.move(i, 0) + except: + pass + else: + for chunk in ansi.text_with_fg_bg_attr(line): + if isinstance(chunk, tuple): + self.set_fg_bg_attr(*chunk) + else: + self.addstr(chunk) def move(self, narg=None, **kw): direction = Direction(kw) -- cgit 1.4.1-2-gfad0