summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/config/commands.py8
-rw-r--r--ranger/core/actions.py2
2 files changed, 6 insertions, 4 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index b6206666..5bad4472 100644
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -715,10 +715,10 @@ class rename(Command):
         if access(new_name, os.F_OK):
             return self.fm.notify("Can't rename: file already exists!", bad=True)
 
-        self.fm.rename(self.fm.thisfile, new_name)
-        f = File(new_name)
-        self.fm.thisdir.pointed_obj = f
-        self.fm.thisfile = f
+        if self.fm.rename(self.fm.thisfile, new_name):
+            f = File(new_name)
+            self.fm.thisdir.pointed_obj = f
+            self.fm.thisfile = f
 
     def tab(self):
         return self._tab_directory_content()
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 20fb2ae9..b3b8f50b 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -1302,3 +1302,5 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
             os.renames(src, dest)
         except OSError as err:
             self.notify(err)
+            return False
+        return True