summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/container/bookmarks.py4
-rw-r--r--ranger/gui/widgets/browserview.py5
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():
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148