summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-01-01 16:51:13 +0100
committerhut <hut@lavabit.com>2010-01-01 16:51:13 +0100
commit4f51adb35feb83365073444b5e31197a82bbda32 (patch)
tree005e0a9148df84954cc17fd7f3268f916d77ef1b /ranger
parent28e13b122c9e695584633a6d4fcaa2006d415357 (diff)
downloadranger-4f51adb35feb83365073444b5e31197a82bbda32.tar.gz
fixed overflow while drawing bookmark list
Diffstat (limited to 'ranger')
-rw-r--r--ranger/gui/curses_shortcuts.py6
-rw-r--r--ranger/gui/widgets/browserview.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/ranger/gui/curses_shortcuts.py b/ranger/gui/curses_shortcuts.py
index b85a2de9..6d1bd7e9 100644
--- a/ranger/gui/curses_shortcuts.py
+++ b/ranger/gui/curses_shortcuts.py
@@ -18,6 +18,12 @@ class CursesShortcuts(SettingsAware):
 		except _curses.error:
 			pass
 
+	def addnstr(self, *args):
+		try:
+			self.win.addnstr(*args)
+		except _curses.error:
+			pass
+
 	def color(self, keylist = None, *keys):
 		"""Change the colors from now on."""
 		keys = combine(keylist, keys)
diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py
index c638f15d..7238d95f 100644
--- a/ranger/gui/widgets/browserview.py
+++ b/ranger/gui/widgets/browserview.py
@@ -67,7 +67,7 @@ class BrowserView(Widget, DisplayableContainer):
 		for line, items in generator():
 			key, mark = items
 			string = " " + key + ": " + mark.path
-			self.addstr(line, 0, string.ljust(maxlen))
+			self.addnstr(line, 0, string.ljust(maxlen), self.wid)
 	
 	def resize(self, y, x, hei, wid):
 		"""Resize all the columns according to the given ratio"""