summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--TODO2
-rw-r--r--ranger/container/bookmarks.py12
2 files changed, 9 insertions, 5 deletions
diff --git a/TODO b/TODO
index cf99c122..3e1d5c8a 100644
--- a/TODO
+++ b/TODO
@@ -24,6 +24,6 @@ General
 
 Bugs
 
-   ( ) #17  10/01/01  why do bookmarks disappear sometimes?
+   (X) #17  10/01/01  why do bookmarks disappear sometimes?
    ( ) #18  10/01/01  fix notify widget (by adding a LogView?)
    (X) #19  10/01/01  resizing after pressing g
diff --git a/ranger/container/bookmarks.py b/ranger/container/bookmarks.py
index 854758bd..738efe46 100644
--- a/ranger/container/bookmarks.py
+++ b/ranger/container/bookmarks.py
@@ -35,7 +35,7 @@ class Bookmarks(object):
 		except OSError:
 			return
 
-		self._set_dict(new_dict)
+		self._set_dict(new_dict, original=new_dict)
 
 	def delete(self, key):
 		"""Delete the bookmark with the given key"""
@@ -93,6 +93,7 @@ class Bookmarks(object):
 		
 		try:
 			real_dict = self._load_dict()
+			real_dict_copy = real_dict.copy()
 		except OSError:
 			return
 
@@ -120,7 +121,7 @@ class Bookmarks(object):
 			else:
 				real_dict[key] = current
 
-		self._set_dict(real_dict)
+		self._set_dict(real_dict, original=real_dict_copy)
 
 	def save(self):
 		"""Save the bookmarks to the bookmarkfile.
@@ -156,10 +157,13 @@ class Bookmarks(object):
 		else:
 			raise OSError('Cannot read the given path')
 	
-	def _set_dict(self, dct):
+	def _set_dict(self, dct, original):
+		if original is None:
+			original = {}
+
 		self.dct.clear()
 		self.dct.update(dct)
-		self.original_dict = self.dct.copy()
+		self.original_dict = original
 		self._update_mtime()
 
 	def _get_mtime(self):
1cd5cb8e681c7e'>^
efdc7b16 ^

a2853ab6 ^
f597489c ^
efdc7b16 ^


f597489c ^
efdc7b16 ^
f597489c ^


efdc7b16 ^

a8f9cf2c ^

efdc7b16 ^






f597489c ^
efdc7b16 ^






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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92