From 291ca616093aed257acf950eb6b8d95229767f9d Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 18 Jan 2010 22:13:40 +0100 Subject: fixed #43: bookmark ` = ' --- TODO | 3 ++- ranger/container/bookmarks.py | 11 ++++++++--- ranger/gui/widgets/browserview.py | 2 +- 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): """ 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 to the keys ` and '""" - self["`"] = value + """Bookmarks 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) -- cgit 1.4.1-2-gfad0 le='author Kartik Agaram <vc@akkartik.com> 2019-07-16 23:34:33 -0700 committer Kartik Agaram <vc@akkartik.com> 2019-07-16 23:40:25 -0700 5408' href='/akkartik/mu/commit/subx/077slurp.subx?h=hlt&id=c2a74205d690862d4df31682aa5bbe992227fda1'>c2a74205 ^
1
2
3
4
5
6
7
8
9
10