summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-02-03 00:52:38 +0100
committerhut <hut@lepus.uberspace.de>2015-02-03 00:52:38 +0100
commitba6efb9da0f58ca03bc28e7f66fdeb88b3de8a1c (patch)
treee30e37d12ef309b396be405b3f3506d72ab28763
parenteb1c977b151af66bb2e4d6f8b7f6667263eb4e76 (diff)
parent2c032e7d2f84c4753c43ad0e9e1a77a929c598e0 (diff)
downloadranger-ba6efb9da0f58ca03bc28e7f66fdeb88b3de8a1c.tar.gz
Merge branch 'bulkrename_flat_fix' of https://github.com/Vifon/ranger
-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