]> Sergey Matveev's repositories - nnn.git/commitdiff
Do not pick multiple times in selection mode
authorArun Prakash Jana <engineerarun@gmail.com>
Tue, 6 Aug 2019 19:56:26 +0000 (01:26 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Tue, 6 Aug 2019 19:57:22 +0000 (01:27 +0530)
src/nnn.c

index e1a8c11f6f20a61cc09fb39bbddaad7c8e87ebc2..a80848eed5baeef478be3f6b18a1a496fab2cc76 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3973,11 +3973,14 @@ nochange:
                                if (!ncp)
                                        writecp(NULL, 0);
 
-                               r = mkpath(path, dents[cur].name, newpath);
-                               appendfpath(newpath, r);
+                               /* Do not select if already selected */
+                               if (!(dents[cur].flags & FILE_COPIED)) {
+                                       r = mkpath(path, dents[cur].name, newpath);
+                                       appendfpath(newpath, r);
 
-                               ++ncp;
-                               dents[cur].flags |= FILE_COPIED;
+                                       ++ncp;
+                                       dents[cur].flags |= FILE_COPIED;
+                               }
 
                                /* move cursor to the next entry if this is not the last entry */
                                if (cur != ndents - 1)