summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-03-28 16:11:56 +0200
committerhut <hut@lavabit.com>2010-03-28 16:11:56 +0200
commit13ace2762cb4eb9775aab18685e25f0f51b213cc (patch)
tree6359704c07adca8dbb6202947b77590f0852e0ef
parent803cb241913c7f3e39f134d94ee056caacde6a6f (diff)
downloadranger-13ace2762cb4eb9775aab18685e25f0f51b213cc.tar.gz
widgets.browserview: fix unicode issue when drawing bookmarks
-rw-r--r--ranger/gui/widgets/browserview.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py
index 6e0fa4ad..9e4eaeee 100644
--- a/ranger/gui/widgets/browserview.py
+++ b/ranger/gui/widgets/browserview.py
@@ -102,6 +102,7 @@ class BrowserView(Widget, DisplayableContainer):
 				pass
 
 	def _draw_bookmarks(self):
+		self.color_reset()
 		self.need_clear = True
 
 		sorted_bookmarks = sorted(item for item in self.fm.bookmarks \
@@ -116,10 +117,12 @@ class BrowserView(Widget, DisplayableContainer):
 			return
 		maxlen = min(maxlen + 5, self.wid-1)
 
+		whitespace = " " * maxlen
 		for line, items in generator():
 			key, mark = items
 			string = " " + key + ": " + mark.path
-			self.addnstr(line, 0, string.ljust(maxlen), self.wid)
+			self.addstr(line, 0, whitespace)
+			self.addnstr(line, 0, string, self.wid)
 		self.win.hline(line, 0, curses.ACS_HLINE, maxlen)
 		self.win.vline(0, maxlen, curses.ACS_VLINE, line)
 		self.win.addch(line, maxlen, curses.ACS_LRCORNER)