From: Arun Prakash Jana Date: Tue, 6 Aug 2019 19:56:26 +0000 (+0530) Subject: Do not pick multiple times in selection mode X-Git-Tag: v2.7~169 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=8ea41dd0e51f42f1c4b53b335ca843ae001acc39;p=nnn.git Do not pick multiple times in selection mode --- diff --git a/src/nnn.c b/src/nnn.c index e1a8c11f..a80848ee 100644 --- 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)