]> Sergey Matveev's repositories - nnn.git/blobdiff - src/nnn.c
F2/F5 cd/cp
[nnn.git] / src / nnn.c
index 566d12c6a84512456cdf1e4287c31b934c008173..2d9f6dbc5cacdbff78f1c58192df04c4e61a5952 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -7889,6 +7889,22 @@ nochange:
                        cd = FALSE;
                        goto begin;
                }
+               case SEL_CD: // fallthrough
+               case SEL_COPY:
+                       if (!xdiraccess(plgpath)) {
+                               printwarn(&presel);
+                               goto nochange;
+                       }
+                       endselection(FALSE);
+                       tmp = sel == SEL_CD ? "!_nnn-cd*" : "!_nnn-cp";
+                       if (!run_plugin(&path, tmp, (ndents ? pdents[cur].name : NULL),
+                                                &lastname, &lastdir)) {
+                               printwait(messages[MSG_FAILED], &presel);
+                               goto nochange;
+                       }
+                       copycurname();
+                       setdirwatch();
+                       goto begin;
                case SEL_PLUGIN:
                        /* Check if directory is accessible */
                        if (!xdiraccess(plgpath)) {