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():
a> ^
b3556b21 ^
62cd83ba ^






4c13e1f2 ^
























1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50