summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/config/commands.py7
-rw-r--r--ranger/core/main.py1
2 files changed, 5 insertions, 3 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index f5dac9ef..453f7f6a 100644
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -779,10 +779,11 @@ class rename_append(Command):
 
     def execute(self):
         cf = self.fm.thisfile
-        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.replace("%", "%%"), position=(7 + cf.relative_path.rfind('.')))
+        path = cf.relative_path.replace("%", "%%")
+        if path.find('.') != 0 and path.rfind('.') != -1 and not cf.is_directory:
+            self.fm.open_console('rename ' + path, position=(7 + path.rfind('.')))
         else:
-            self.fm.open_console('rename ' + cf.relative_path.replace("%", "%%"))
+            self.fm.open_console('rename ' + path)
 
 class chmod(Command):
     """:chmod <octal number>
diff --git a/ranger/core/main.py b/ranger/core/main.py
index 96f56bf1..4c7c9482 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -107,6 +107,7 @@ def main():
         if fm.username == 'root':
             fm.settings.preview_files = False
             fm.settings.use_preview_script = False
+            fm.log.append("Running as root, disabling the file previews.")
         if not arg.debug:
             from ranger.ext import curses_interrupt_handler
             curses_interrupt_handler.install_interrupt_handler()