summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-01-01 19:25:47 +0100
committerhut <hut@lavabit.com>2010-01-01 19:25:47 +0100
commit0a1bc7598776c360b469a64316a1c69c0a914b5f (patch)
treed4c2da5c32d5216a2d6d478f0ed5ea41f85d8bec /ranger
parentd955e3f04a2b0509e8053a15a1f916bfb5677af2 (diff)
downloadranger-0a1bc7598776c360b469a64316a1c69c0a914b5f.tar.gz
bookmarks: added testcase, documentation, setting
Diffstat (limited to 'ranger')
-rw-r--r--ranger/container/bookmarks.py8
-rw-r--r--ranger/defaults/options.py1
-rw-r--r--ranger/fm.py2
-rw-r--r--ranger/shared/settings.py2
4 files changed, 8 insertions, 5 deletions
diff --git a/ranger/container/bookmarks.py b/ranger/container/bookmarks.py
index 738efe46..98fdc402 100644
--- a/ranger/container/bookmarks.py
+++ b/ranger/container/bookmarks.py
@@ -98,6 +98,7 @@ class Bookmarks(object):
 			return
 
 		for key in set(self.dct.keys()) | set(real_dict.keys()):
+			# set some variables
 			if key in self.dct:
 				current = self.dct[key]
 			else:
@@ -113,13 +114,14 @@ class Bookmarks(object):
 			else:
 				real = None
 
+			# determine if there have been changes
 			if current == original and current != real:
-				continue
+				continue   # another ranger instance has changed the bookmark
 
 			if key not in self.dct:
-				del real_dict[key]
+				del real_dict[key]   # the user has deleted it
 			else:
-				real_dict[key] = current
+				real_dict[key] = current   # the user has changed it
 
 		self._set_dict(real_dict, original=real_dict_copy)
 
diff --git a/ranger/defaults/options.py b/ranger/defaults/options.py
index d4172eee..6467369b 100644
--- a/ranger/defaults/options.py
+++ b/ranger/defaults/options.py
@@ -11,6 +11,7 @@ directories_first = True
 preview_files = False
 max_history_size = 20
 auto_load_preview = True
+autosave_bookmarks = True
 
 max_dirsize_for_autopreview = None
 sort = 'basename'
diff --git a/ranger/fm.py b/ranger/fm.py
index 2fb7e21c..e70e9f3c 100644
--- a/ranger/fm.py
+++ b/ranger/fm.py
@@ -33,7 +33,7 @@ class FM(Actions):
 			self.bookmarks = Bookmarks(
 					bookmarkfile=relpath_conf('bookmarks'),
 					bookmarktype=Directory,
-					autosave=False)
+					autosave=self.settings.autosave_bookmarks)
 			self.bookmarks.load()
 
 		else:
diff --git a/ranger/shared/settings.py b/ranger/shared/settings.py
index ec7abedf..644d1318 100644
--- a/ranger/shared/settings.py
+++ b/ranger/shared/settings.py
@@ -3,7 +3,7 @@ show_hidden scroll_offset
 directories_first sort reverse
 preview_files max_history_size colorscheme
 collapse_preview auto_load_preview
-max_dirsize_for_autopreview
+max_dirsize_for_autopreview autosave_bookmarks
 apps keys
 """.split()
 
t; 2015-05-13 10:03:26 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2015-05-13 10:03:26 -0700 1363 - rename 'integer' to 'number'' href='/akkartik/mu/commit/036call_ingredient.cc?h=main&id=5497090aa1e708c22cd240913a53dda32bb067aa'>5497090a ^
4be9a93b ^


ca01193d ^
fca0ebbe ^
016599f1 ^
b24eb476 ^
50eab110 ^

69f04c3f ^
3eeea0a2 ^
b24eb476 ^
67573caf ^
3473c63a ^
c9a5a7ba ^
016599f1 ^
78a12c9d ^
1fa53058 ^
69f04c3f ^
1848b18f ^

69f04c3f ^
795f5244 ^
166e3c0d ^
69f04c3f ^
166e3c0d ^
8d72e565 ^
e4630643 ^

166e3c0d ^



31401373 ^
67573caf ^
3473c63a ^
c9a5a7ba ^
3a982057 ^


78c50205 ^
9dcbec39 ^
3a982057 ^
81c87f08 ^

9dcbec39 ^
691b529e ^
1fa53058 ^
0487a30e ^
67573caf ^
ac0e9db5 ^
0487a30e ^
67573caf ^
69f04c3f ^
4be9a93b ^
3e849f11 ^
9dcbec39 ^
75aa3a98 ^
0487a30e ^
75aa3a98 ^
b24eb476 ^

75aa3a98 ^
0487a30e ^
4be9a93b ^
69f04c3f ^

717ab659 ^
5f98a10c ^

1ead3562 ^
3e849f11 ^

1ead3562 ^
3e849f11 ^

9dcbec39 ^
3e849f11 ^
88be3dbc ^
1ead3562 ^
bc643692 ^
717ab659 ^
1ead3562 ^
5497090a ^
717ab659 ^

5497090a ^
717ab659 ^








795f5244 ^
166e3c0d ^



717ab659 ^

67573caf ^
717ab659 ^


88be3dbc ^
1ead3562 ^
bc643692 ^
717ab659 ^
1ead3562 ^
bc643692 ^
5497090a ^
717ab659 ^






795f5244 ^
166e3c0d ^
717ab659 ^
166e3c0d ^
8d72e565 ^
e4630643 ^

5f98a10c ^
9dcbec39 ^
e4630643 ^

166e3c0d ^



b24eb476 ^
67573caf ^
0487a30e ^
67573caf ^
ac0e9db5 ^
827898fc ^
67573caf ^
717ab659 ^

ac0e9db5 ^
0487a30e ^

827898fc ^
717ab659 ^



c9a5a7ba ^
78c50205 ^
c9a5a7ba ^
78c50205 ^

c9a5a7ba ^
af023b32 ^









c9a5a7ba ^
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
93
94
95
96
97
98
99
100
101
102
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189