diff options
author | hut <hut@lavabit.com> | 2010-03-28 16:28:32 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-03-28 16:28:32 +0200 |
commit | 451fe138e6cb2ed2cc208f4d83faaaae3ac62168 (patch) | |
tree | 1329182cc14b6452df4ebbbbbbd52d9c5250f2af | |
parent | 13ace2762cb4eb9775aab18685e25f0f51b213cc (diff) | |
download | ranger-451fe138e6cb2ed2cc208f4d83faaaae3ac62168.tar.gz |
widgets.browserview: improved bookmark preview border
skip drawing of the right border if its too wide
-rw-r--r-- | ranger/gui/widgets/browserview.py | 7 |
1 files 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 |