From 2c032e7d2f84c4753c43ad0e9e1a77a929c598e0 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Mon, 2 Feb 2015 00:25:42 +0100 Subject: config.commands: bulkrename works with `:flat -1` Fixes #241. --- ranger/config/commands.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit 1.4.1-2-gfad0