about 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()