summary refs log tree commit diff stats
path: root/ranger/config
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-06-02 16:10:56 +0200
committerhut <hut@lepus.uberspace.de>2015-06-02 16:10:56 +0200
commit4cd48ead34d04a7cad41d012ee5670db9c90ed08 (patch)
tree7d98519b2f12dfd2340379fe4638baefb5291011 /ranger/config
parent984845bac7a6cc142e676557685daa66a468494e (diff)
parentdff0e71b2aa0c4f74816db0ffdd0c662836652cf (diff)
downloadranger-4cd48ead34d04a7cad41d012ee5670db9c90ed08.tar.gz
Merge branch 'flat_path_fixes' of https://github.com/Vifon/ranger
Diffstat (limited to 'ranger/config')
-rw-r--r--ranger/config/commands.py18
-rw-r--r--ranger/config/rc.conf4
2 files changed, 11 insertions, 11 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index cb62a62b..acc98457 100644
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -520,7 +520,7 @@ class delete(Command):
 
         if confirm != 'never' and (confirm != 'multiple' or many_files):
             self.fm.ui.console.ask("Confirm deletion of: %s (y/N)" %
-                ', '.join(f.basename for f in self.fm.thistab.get_selection()),
+                ', '.join(f.relative_path for f in self.fm.thistab.get_selection()),
                 self._question_callback, ('n', 'N', 'y', 'Y'))
         else:
             # no need for a confirmation, just delete
@@ -733,7 +733,7 @@ class rename(Command):
         new_name = self.rest(1)
 
         tagged = {}
-        old_name = self.fm.thisfile.basename
+        old_name = self.fm.thisfile.relative_path
         for f in self.fm.tags.tags:
             if str(f).startswith(self.fm.thisfile.path):
                 tagged[f] = self.fm.tags.tags[f]
@@ -742,7 +742,7 @@ class rename(Command):
         if not new_name:
             return self.fm.notify('Syntax: rename <newname>', bad=True)
 
-        if new_name == self.fm.thisfile.basename:
+        if new_name == old_name:
             return
 
         if access(new_name, os.F_OK):
@@ -767,10 +767,10 @@ class rename_append(Command):
 
     def execute(self):
         cf = self.fm.thisfile
-        if cf.basename.find('.') != 0 and cf.basename.rfind('.') != -1 and not cf.is_directory:
-            self.fm.open_console('rename ' + cf.basename, position=(7 + cf.basename.rfind('.')))
+        if cf.relative_path.find('.') != 0 and cf.relative_path.rfind('.') != -1 and not cf.is_directory:
+            self.fm.open_console('rename ' + cf.relative_path, position=(7 + cf.relative_path.rfind('.')))
         else:
-            self.fm.open_console('rename ' + cf.basename)
+            self.fm.open_console('rename ' + cf.relative_path)
 
 class chmod(Command):
     """:chmod <octal number>
@@ -905,7 +905,7 @@ class relink(Command):
             return self.fm.notify('Syntax: relink <newpath>', bad=True)
 
         if not cf.is_link:
-            return self.fm.notify('%s is not a symlink!' % cf.basename, bad=True)
+            return self.fm.notify('%s is not a symlink!' % cf.relative_path, bad=True)
 
         if new_path == os.readlink(cf.path):
             return
@@ -1134,7 +1134,7 @@ class scout(Command):
                     thisdir.mark_item(f, value)
             else:
                 for f in thisdir.files:
-                    if regex.search(f.basename):
+                    if regex.search(f.relative_path):
                         thisdir.mark_item(f, value)
 
         if self.PERM_FILTER in flags:
@@ -1242,7 +1242,7 @@ class scout(Command):
         i = offset
         regex = self._build_regex()
         for fsobj in deq:
-            if regex.search(fsobj.basename):
+            if regex.search(fsobj.relative_path):
                 count += 1
                 if move and count == 1:
                     cwd.move(to=(cwd.pointer + i) % len(cwd.files))
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index 727ba7b3..f34b6e0c 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -339,8 +339,8 @@ map =  chmod
 
 map cw console rename%space
 map a  rename_append
-map A  eval fm.open_console('rename ' + fm.thisfile.basename)
-map I  eval fm.open_console('rename ' + fm.thisfile.basename, position=7)
+map A  eval fm.open_console('rename ' + fm.thisfile.relative_path)
+map I  eval fm.open_console('rename ' + fm.thisfile.relative_path, position=7)
 
 map pp paste
 map po paste overwrite=True