From 42061b0399008f0ae7a2863e8a8e0e0465c41d62 Mon Sep 17 00:00:00 2001
From: Arun Prakash Jana <engineerarun@gmail.com>
Date: Thu, 12 Aug 2021 00:20:13 +0530
Subject: [PATCH] Fail operations if selection file is empty
---
src/nnn.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/nnn.c b/src/nnn.c
index 0d58ca25..b7654280 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2541,7 +2541,9 @@ static bool cpmvrm_selection(enum action sel, char *path)
{
int r;
- if (!selbufpos && isselfileempty()) {
+ if (isselfileempty()) {
+ if (nselected)
+ clearselection();
printmsg(messages[MSG_0_SELECTED]);
return FALSE;
}
--
2.51.0