From 4f51adb35feb83365073444b5e31197a82bbda32 Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 1 Jan 2010 16:51:13 +0100 Subject: fixed overflow while drawing bookmark list --- TODO | 1 + ranger/gui/curses_shortcuts.py | 6 ++++++ ranger/gui/widgets/browserview.py | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 2b996543..ffafc92d 100644 --- a/TODO +++ b/TODO @@ -26,3 +26,4 @@ Bugs ( ) #17 10/01/01 why do bookmarks disappear sometimes? ( ) #18 10/01/01 fix notify widget (by adding a LogView?) + ( ) #19 10/01/01 resizing after pressing g 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""" -- cgit 1.4.1-2-gfad0