summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-01-18 22:13:40 +0100
committerhut <hut@lavabit.com>2010-01-18 22:13:40 +0100
commit291ca616093aed257acf950eb6b8d95229767f9d (patch)
tree7eec9ff4be1340adcf5a21389fe76e14c622d107
parenteb0630588e44f2c4ddb32247ac979bdfe8c118f4 (diff)
downloadranger-291ca616093aed257acf950eb6b8d95229767f9d.tar.gz
fixed #43: bookmark ` = '
-rw-r--r--TODO3
-rw-r--r--ranger/container/bookmarks.py11
-rw-r--r--ranger/gui/widgets/browserview.py2
3 files changed, 11 insertions, 5 deletions
diff --git a/TODO b/TODO
index 824c40f6..ed420d3c 100644
--- a/TODO
+++ b/TODO
@@ -32,7 +32,7 @@ General
    ( ) #38  10/01/16  searching in pager
    ( ) #39  10/01/17  flushinput not always good
    (X) #42  10/01/17  memorize directory for `` when using :cd
-   ( ) #43  10/01/18  internally treat the bookmarks ` and ' the same
+   (X) #43  10/01/18  internally treat the bookmarks ` and ' the same
    ( ) #44  10/01/18  more error messages :P
 
 
@@ -56,3 +56,4 @@ Ideas
    (X) #27  10/01/06  hide bookmarks in list which contain hidden dir
    (X) #28  10/01/06  use regexp instead of string for searching
    ( ) #33  10/01/08  accelerate mousewheel speed
+   ( ) #45  10/01/18  hooks for events like setting changes
diff --git a/ranger/container/bookmarks.py b/ranger/container/bookmarks.py
index 4c9a48d4..56671a42 100644
--- a/ranger/container/bookmarks.py
+++ b/ranger/container/bookmarks.py
@@ -31,7 +31,7 @@ class Bookmarks(object):
 
 	last_mtime = None
 	autosave = True
-	load_pattern = re.compile(r"^[\d\w`']:.")
+	load_pattern = re.compile(r"^[\d\w']:.")
 
 	def __init__(self, bookmarkfile, bookmarktype=str, autosave=False):
 		"""<bookmarkfile> specifies the path to the file where
@@ -53,6 +53,8 @@ class Bookmarks(object):
 
 	def delete(self, key):
 		"""Delete the bookmark with the given key"""
+		if key == '`':
+			key = "'"
 		if key in self.dct:
 			del self.dct[key]
 			if self.autosave: self.save()
@@ -72,8 +74,7 @@ class Bookmarks(object):
 			self.update()
 
 	def remember(self, value):
-		"""Bookmarks <value> to the keys ` and '"""
-		self["`"] = value
+		"""Bookmarks <value> to the key '"""
 		self["'"] = value
 		if self.autosave: self.save()
 	
@@ -82,6 +83,8 @@ class Bookmarks(object):
 
 	def __getitem__(self, key):
 		"""Get the bookmark associated with the key"""
+		if key == '`':
+			key = "'"
 		if key in self.dct:
 			return self.dct[key]
 		else:
@@ -92,6 +95,8 @@ class Bookmarks(object):
 		key is expected to be a 1-character string and element of ALLOWED_KEYS.
 		value is expected to be a filesystemobject.
 		"""
+		if key == '`':
+			key = "'"
 		if key in ALLOWED_KEYS:
 			self.dct[key] = value
 			if self.autosave: self.save()
diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py
index 7a7e43e6..797daa59 100644
--- a/ranger/gui/widgets/browserview.py
+++ b/ranger/gui/widgets/browserview.py
@@ -72,7 +72,7 @@ class BrowserView(Widget, DisplayableContainer):
 		self.need_clear = True
 
 		sorted_bookmarks = sorted(item for item in self.fm.bookmarks \
-				if item[0] != '`' and '/.' not in item[1].path)
+				if '/.' not in item[1].path)
 
 		def generator():
 			return zip(range(self.hei), sorted_bookmarks)