From 451fe138e6cb2ed2cc208f4d83faaaae3ac62168 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 28 Mar 2010 16:28:32 +0200 Subject: widgets.browserview: improved bookmark preview border skip drawing of the right border if its too wide --- ranger/gui/widgets/browserview.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py index 9e4eaeee..fe98cff2 100644 --- a/ranger/gui/widgets/browserview.py +++ b/ranger/gui/widgets/browserview.py @@ -115,7 +115,7 @@ class BrowserView(Widget, DisplayableContainer): maxlen = max(len(item[1].path) for i, item in generator()) except ValueError: return - maxlen = min(maxlen + 5, self.wid-1) + maxlen = min(maxlen + 5, self.wid) whitespace = " " * maxlen for line, items in generator(): @@ -124,8 +124,9 @@ class BrowserView(Widget, DisplayableContainer): 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) + if maxlen < self.wid: + self.win.vline(0, maxlen, curses.ACS_VLINE, line) + self.win.addch(line, maxlen, curses.ACS_LRCORNER) def _draw_borders(self): win = self.win -- cgit 1.4.1-2-gfad0