]> Sergey Matveev's repositories - nnn.git/commitdiff
Use option -A to disable dir auto-select
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 8 Jan 2020 22:04:10 +0000 (03:34 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 8 Jan 2020 22:04:10 +0000 (03:34 +0530)
misc/auto-completion/bash/nnn-completion.bash
misc/auto-completion/fish/nnn.fish
misc/auto-completion/zsh/_nnn
nnn.1
src/nnn.c

index 86102bd4606d2b01881e91b6baa880974a7896b9..74349e6a92808baa2e5200cf845983ce69f0e3f1 100644 (file)
@@ -13,6 +13,7 @@ _nnn ()
     local -a opts
     opts=(
         -a
+        -A
         -b
         -c
         -d
@@ -28,7 +29,6 @@ _nnn ()
         -R
         -s
         -S
-        -t
         -v
         -V
         -x
index 96348bd77ae6445319857fccb09d26bef479b03f..9358882d7a55d12852ac59d2dd8a15f248b6caaa 100644 (file)
@@ -12,6 +12,7 @@ else
 end
 
 complete -c nnn -s a    -d 'use access time'
+complete -c nnn -s A    -d 'disable dir auto-select'
 complete -c nnn -s b -r -d 'bookmark key to open' -x -a '(echo $NNN_BMS | awk -F: -v RS=\; \'{print $1"\t"$2}\')'
 complete -c nnn -s c    -d 'cli-only opener'
 complete -c nnn -s d    -d 'start in detail mode'
@@ -27,7 +28,6 @@ complete -c nnn -s r    -d 'show cp, mv progress (Linux-only)'
 complete -c nnn -s R    -d 'disable rollover at edges'
 complete -c nnn -s s -r -d 'load session by name' -x -a '@\t"last session" (ls $sessions_dir)'
 complete -c nnn -s S    -d 'start in disk usage analyzer mode'
-complete -c nnn -s t    -d 'disable dir auto-select'
 complete -c nnn -s v    -d 'use version compare to sort files'
 complete -c nnn -s V    -d 'show program version and exit'
 complete -c nnn -s x    -d 'notis, sel to system clipboard'
index 7aa9ba40b878df823dc44a30aa40c18919077e9c..d36d6ee374c71db15740ccab54a647c1f8fd7e88 100644 (file)
@@ -10,6 +10,7 @@ setopt localoptions noshwordsplit noksharrays
 local -a args
 args=(
     '(-a)-a[use access time]'
+    '(-A)-A[disable dir auto-select]'
     '(-b)-b[bookmark key to open]:key char'
     '(-c)-c[cli-only opener]'
     '(-d)-d[start in detail mode]'
@@ -25,7 +26,6 @@ args=(
     '(-R)-R[disable rollover at edges]'
     '(-s)-s[load session]:session name'
     '(-S)-S[start in disk usage analyzer mode]'
-    '(-t)-t[disable dir auto-select]'
     '(-v)-v[use version compare to sort files]'
     '(-V)-V[show program version and exit]'
     '(-x)-x[notis, sel to system clipboard]'
diff --git a/nnn.1 b/nnn.1
index ee555f648407ac44183c1b269993e8c22ae478a9..d6725a6b7157ddc7c5336fb5d368a1bc0bc53d03 100644 (file)
--- a/nnn.1
+++ b/nnn.1
@@ -7,6 +7,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Ar -a
+.Op Ar -A
 .Op Ar -b key
 .Op Ar -c
 .Op Ar -d
@@ -47,6 +48,9 @@ supports the following options:
 .Fl a
         use access time for all operations (default: modification time)
 .Pp
+.Fl A
+        disable directory auto-select in navigate-as-you-type mode
+.Pp
 .Fl "b key"
         specify bookmark key to open
 .Pp
@@ -92,9 +96,6 @@ supports the following options:
 .Fl S
         start in disk usage analyzer mode
 .Pp
-.Fl t
-        disable directory auto-select in navigate-as-you-type mode
-.Pp
 .Fl v
         use case-insensitive version compare to sort files
 .Pp
index bc05ecadd96c6aa4243b367b0d9b698d61ba4ea8..815d5d9f0626c79230e51ef7a306c7d47c165f1d 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -5506,6 +5506,7 @@ static void usage(void)
                "  PATH   start dir [default: .]\n\n"
                "optional args:\n"
                " -a      use access time\n"
+               " -A      no dir auto-select\n"
                " -b key  open bookmark key\n"
                " -c      cli-only opener\n"
                " -d      detail mode\n"
@@ -5521,7 +5522,6 @@ static void usage(void)
                " -R      no rollover at edges\n"
                " -s name load session by name\n"
                " -S      du mode\n"
-               " -t      no dir auto-select\n"
                " -v      version sort\n"
                " -V      show version\n"
                " -x      notis, sel to system clipboard\n"
@@ -5667,7 +5667,7 @@ int main(int argc, char *argv[])
        bool progress = FALSE;
 #endif
 
-       while ((opt = getopt(argc, argv, "HSKab:cdEgnop:QrRs:tvVxh")) != -1) {
+       while ((opt = getopt(argc, argv, "HSKaAb:cdEgnop:QrRs:vVxh")) != -1) {
                switch (opt) {
                case 'S':
                        cfg.blkorder = 1;
@@ -5680,6 +5680,9 @@ int main(int argc, char *argv[])
                case 'a':
                        cfg.mtime = 0;
                        break;
+               case 'A':
+                       cfg.autoselect = 0;
+                       break;
                case 'b':
                        arg = optarg;
                        break;
@@ -5733,9 +5736,6 @@ int main(int argc, char *argv[])
                case 's':
                        session = optarg;
                        break;
-               case 't':
-                       cfg.autoselect = 0;
-                       break;
                case 'K':
                        check_key_collision();
                        return _SUCCESS;