about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-09-14 15:15:53 +0200
committerhut <hut@lavabit.com>2011-09-14 15:20:18 +0200
commit98761094d8e9f43fae4342e44c2bcdc6dea59331 (patch)
tree7249bf09a877764fe39cba30bc765ef84ef7ed6f /ranger
parentd873a5604911659080acd7ba9788da6698641f4c (diff)
downloadranger-98761094d8e9f43fae4342e44c2bcdc6dea59331.tar.gz
gui.widgets.pager: fixed crash
Diffstat (limited to 'ranger')
-rw-r--r--ranger/gui/widgets/pager.py16
1 files 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)