summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2016-03-25 10:46:36 +0100
committerhut <hut@lepus.uberspace.de>2016-03-25 10:46:36 +0100
commit34ab9bfb6a3048e396452de48b39664a7b85ff9f (patch)
tree4704b9c55904bfbc88ee59b887a0e2f3fa8dda87 /ranger
parente13b9212537e3cdcf586e946aff731aaf051b21a (diff)
parentf6bdde502d0a08f80783e4035d09543f821bc72a (diff)
downloadranger-34ab9bfb6a3048e396452de48b39664a7b85ff9f.tar.gz
Merge branch 'set-bookmark-not-current' of https://github.com/cirosantilli/ranger
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index a22b9cd8..a168a095 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -23,6 +23,7 @@ from ranger.ext.next_available_filename import next_available_filename
 from ranger.ext.rifle import squash_flags, ASK_COMMAND
 from ranger.core.shared import FileManagerAware, SettingsAware
 from ranger.core.tab import Tab
+from ranger.container.directory import Directory
 from ranger.container.file import File
 from ranger.core.loader import CommandLoader, CopyLoader
 from ranger.container.settings import ALLOWED_SETTINGS
@@ -783,10 +784,14 @@ class Actions(FileManagerAware, SettingsAware):
         except KeyError:
             pass
 
-    def set_bookmark(self, key):
+    def set_bookmark(self, key, val=None):
         """Set the bookmark with the name <key> to the current directory"""
+        if val is None:
+            val = self.thisdir
+        else:
+            val = Directory(val)
         self.bookmarks.update_if_outdated()
-        self.bookmarks[str(key)] = self.thisdir
+        self.bookmarks[str(key)] = val
 
     def unset_bookmark(self, key):
         """Delete the bookmark with the name <key>"""