]> Sergey Matveev's repositories - nnn.git/commitdiff
Return selection if external selection exists
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 28 Apr 2021 08:07:03 +0000 (13:37 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 28 Apr 2021 08:07:03 +0000 (13:37 +0530)
src/nnn.c

index 9ad2eb431e7ef31ee42389e3f23a98221e9451ba..53ec3fcfe8794770b3654a63de8651b1854934c3 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1280,7 +1280,7 @@ static int get_cur_or_sel(void)
                return ((choice == 'c' || choice == 's') ? choice : 0);
        }
 
-       if (selbufpos)
+       if (selbufpos || !isselfileempty())
                return 's';
 
        if (ndents)
@@ -1519,7 +1519,7 @@ static int editselection(void)
        struct stat sb;
        time_t mtime;
 
-       if (!selbufpos)
+       if (!selbufpos) /* External selection is only editable at source */
                return listselfile();
 
        fd = create_tmp_file();