]> Sergey Matveev's repositories - nnn.git/commitdiff
Preserve attributes on duplicate, update docs
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 11 Sep 2019 12:58:41 +0000 (18:28 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 11 Sep 2019 12:58:41 +0000 (18:28 +0530)
README.md
nnn.1
src/nnn.c

index fbd36a05adc2f1795871ffafc5ee8d6c38d69c27..e6d0d6b6b9f96152dfb9b4aa49bbaf1e64722a56 100644 (file)
--- a/README.md
+++ b/README.md
@@ -214,7 +214,7 @@ optional args:
  -a      use access time
  -b key  open bookmark key
  -d      detail mode
- -f      run filter as cmd on ^P
+ -f      run filter as cmd on prompt key
  -H      show hidden files
  -i      nav-as-you-type mode
  -n      version sort
diff --git a/nnn.1 b/nnn.1
index acc8493144d8f76a25d5eeac0fd4947178794566..dbe618f7aeec7cf8894aafc2c81250ec574d8071 100644 (file)
--- a/nnn.1
+++ b/nnn.1
@@ -48,7 +48,7 @@ supports the following options:
         detail mode
 .Pp
 .Fl f
-        run filter as command when ^P is pressed
+        run filter as command when the prompt key is pressed
 .Pp
 .Fl H
         show hidden files
@@ -120,7 +120,7 @@ with a '^' (caret) symbol.
 .Pp
 There is a program option to filter entries by substring match instead of regex.
 .Pp
-There is a program option to execute the current filter as a command when \fI^P\fR is pressed.
+There is a program option to execute the current filter as a command when the prompt key is pressed.
 .Pp
 In the \fInavigate-as-you-type\fR mode directories are opened in filter mode,
 allowing continuous navigation. Works best with the \fBarrow keys\fR.
index 0ad0a691547bf0f22e37fe5735c777be3cd966f8..666b92099dfa61585f62eacc9acc618180abb169 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
 #define F_NORMAL  0x08  /* spawn child process in non-curses regular CLI mode */
 #define F_CMD     0x10  /* run command - show results before exit (must have F_NORMAL) */
 #define F_CLI     (F_NORMAL | F_MULTI)
+#define F_SILENT  (F_CLI | F_NOTRACE)
 
 /* CRC8 macros */
 #define UCHAR_BIT_WIDTH  (sizeof(unsigned char) << 3)
@@ -4279,7 +4280,7 @@ nochange:
                        if (sel == SEL_RENAME) {
                                /* Rename the file */
                                if (dup == 'd')
-                                       spawn("cp -r", dents[cur].name, tmp, path, F_CLI | F_NOTRACE);
+                                       spawn("cp -rp", dents[cur].name, tmp, path, F_SILENT);
                                else if (renameat(fd, dents[cur].name, fd, tmp) != 0) {
                                        close(fd);
                                        printwarn(&presel);
@@ -4535,7 +4536,7 @@ static void usage(void)
                " -a      use access time\n"
                " -b key  open bookmark key\n"
                " -d      detail mode\n"
-               " -f      run filter as cmd on ^P\n"
+               " -f      run filter as cmd on prompt key\n"
                " -H      show hidden files\n"
                " -i      nav-as-you-type mode\n"
                " -n      version sort\n"