summary refs log tree commit diff stats
path: root/ranger/core/actions.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/core/actions.py')
-rw-r--r--ranger/core/actions.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 634bb7f8..e45326f3 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -1306,24 +1306,20 @@ class Actions(FileManagerAware, SettingsAware):
         self.loader.add(loadable, append=append)
         self.do_cut = False
 
-    def delete(self, files=None):
+    def delete(self, files):
         # XXX: warn when deleting mount points/unseen marked files?
         self.notify("Deleting!")
-        if files is None:
-            selected = self.thistab.get_selection()
-        else:
-            selected = [File(os.path.expanduser(f)) for f in files]
-        self.copy_buffer -= set(selected)
-        if selected:
-            for f in selected:
-                if isdir(f.path) and not os.path.islink(f.path):
+        self.copy_buffer = set(filter(lambda f: f.path not in files, self.copy_buffer))
+        if files:
+            for f in files:
+                if isdir(f) and not os.path.islink(f):
                     try:
-                        shutil.rmtree(f.path)
+                        shutil.rmtree(f)
                     except OSError as err:
                         self.notify(err)
                 else:
                     try:
-                        os.remove(f.path)
+                        os.remove(f)
                     except OSError as err:
                         self.notify(err)
         self.thistab.ensure_correct_pointer()