From 4095f32154ed738c1b28bbe8e1554cf4aab9c233 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 5 Feb 2013 04:42:10 +0100 Subject: config/commands: helpful error message for :delete in empty dir --- ranger/config/commands.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ranger/config/commands.py b/ranger/config/commands.py index 74d306e8..f5f5b03d 100644 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -514,6 +514,9 @@ class delete(Command): cwd = self.fm.thisdir cf = self.fm.thisfile + if not cwd or not cf: + self.fm.notify("Error: no file selected for deletion!", bad=True) + return confirm = self.fm.settings.confirm_on_delete many_files = (cwd.marked_items or (cf.is_directory and not cf.is_link \ -- cgit 1.4.1-2-gfad0