about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWojciech Siewierski <wojciech.siewierski@onet.pl>2015-02-02 00:25:42 +0100
committerWojciech Siewierski <wojciech.siewierski@onet.pl>2015-02-02 00:25:42 +0100
commit2c032e7d2f84c4753c43ad0e9e1a77a929c598e0 (patch)
treedc61bc241f59b3ac29941f582797f296680e23ee
parent1e452164dcbc02e4106fc2f90aa02580cf3449e8 (diff)
downloadranger-2c032e7d2f84c4753c43ad0e9e1a77a929c598e0.tar.gz
config.commands: bulkrename works with `:flat -1`
Fixes #241.
-rw-r--r--ranger/config/commands.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index 78e6fe8f..774618bd 100644
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -788,12 +788,14 @@ class bulkrename(Command):
     def execute(self):
         import sys
         import tempfile
+        from os.path import relpath
         from ranger.container.file import File
         from ranger.ext.shell_escape import shell_escape as esc
         py3 = sys.version > "3"
 
         # Create and edit the file list
-        filenames = [f.basename for f in self.fm.thistab.get_selection()]
+        filenames = [relpath(f.path, start=self.fm.thisdir.path)
+                     for f in self.fm.thistab.get_selection()]
         listfile = tempfile.NamedTemporaryFile(delete=False)
         listpath = listfile.name