summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-02-05 04:42:10 +0100
committerhut <hut@lavabit.com>2013-02-05 04:42:10 +0100
commit4095f32154ed738c1b28bbe8e1554cf4aab9c233 (patch)
treee7e92a85e31961f33e69fa7a1b5d5911da131ca7
parent5036975750fb3447f5a060bf1523773eb25d3313 (diff)
downloadranger-4095f32154ed738c1b28bbe8e1554cf4aab9c233.tar.gz
config/commands: helpful error message for :delete in empty dir
-rw-r--r--ranger/config/commands.py3
1 files changed, 3 insertions, 0 deletions
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 \