]> Sergey Matveev's repositories - nnn.git/commitdiff
Auto-proceed to next entry in selection mode
authorArun Prakash Jana <engineerarun@gmail.com>
Tue, 6 Aug 2019 19:21:54 +0000 (00:51 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Tue, 6 Aug 2019 19:21:54 +0000 (00:51 +0530)
src/nnn.c

index 37e87605eb98459de23b9b78aedffc7541a4ab61..e1a8c11f6f20a61cc09fb39bbddaad7c8e87ebc2 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3977,6 +3977,11 @@ nochange:
                                appendfpath(newpath, r);
 
                                ++ncp;
+                               dents[cur].flags |= FILE_COPIED;
+
+                               /* move cursor to the next entry if this is not the last entry */
+                               if (cur != ndents - 1)
+                                       move_cursor((cur + 1) % ndents, 0);
                        } else {
                                r = mkpath(path, dents[cur].name, newpath);
 
@@ -3990,9 +3995,9 @@ nochange:
 
                                writecp(newpath, r - 1); /* Truncate NULL from end */
                                spawn(copier, NULL, NULL, NULL, F_NOTRACE);
-                       }
 
-                       dents[cur].flags |= FILE_COPIED;
+                               dents[cur].flags |= FILE_COPIED;
+                       }
                        break;
                case SEL_COPYMUL:
                        cfg.copymode ^= 1;