diff options
-rw-r--r-- | ranger/container/bookmarks.py | 4 | ||||
-rw-r--r-- | ranger/gui/widgets/browserview.py | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/ranger/container/bookmarks.py b/ranger/container/bookmarks.py index 2d58c1d8..6c2ebd63 100644 --- a/ranger/container/bookmarks.py +++ b/ranger/container/bookmarks.py @@ -143,6 +143,10 @@ class Bookmarks(object): def _load_dict(self): import os dct = {} + if not os.path.exists(self.path): + f = open(self.path, 'w') + f.close() + if os.access(self.path, os.R_OK): f = open(self.path, 'r') for line in f: diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py index 7238d95f..3fae7715 100644 --- a/ranger/gui/widgets/browserview.py +++ b/ranger/gui/widgets/browserview.py @@ -61,7 +61,10 @@ class BrowserView(Widget, DisplayableContainer): def generator(): return zip(range(self.hei), sorted_bookmarks) - maxlen = max(len(item[1].path) for i, item in generator()) + try: + maxlen = max(len(item[1].path) for i, item in generator()) + except ValueError: + return maxlen = min(maxlen + 5, self.wid) for line, items in generator(): |