]> Sergey Matveev's repositories - nnn.git/commitdiff
Remove wild load option
authorArun Prakash Jana <engineerarun@gmail.com>
Tue, 20 Aug 2019 14:30:48 +0000 (20:00 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Tue, 20 Aug 2019 14:30:48 +0000 (20:00 +0530)
README.md
misc/auto-completion/bash/nnn-completion.bash
misc/auto-completion/fish/nnn.fish
misc/auto-completion/zsh/_nnn
nnn.1
src/nnn.c
src/nnn.h

index bab48c489628714a2bf41b3de7092b5639bde6ec..1f8753b471a3561cf7614d60b1d0dab26e256205 100644 (file)
--- a/README.md
+++ b/README.md
@@ -70,7 +70,7 @@ Visit the **[Wiki](https://github.com/jarun/nnn/wiki)** for how tos, use cases,
   - Disk usage analyzer (block/apparent)
   - File picker, (neo)vim plugin
 - Navigation
-  - *Navigate-as-you-type* with dir auto-select, *wild load*
+  - *Navigate-as-you-type* with dir auto-select
   - 4 contexts (_aka_ tabs/workspaces)
   - Bookmarks; pin and visit a directory
   - Familiar, easy shortcuts (arrows, <kbd>~</kbd>, <kbd>-</kbd>, <kbd>@</kbd>)
@@ -209,7 +209,7 @@ Option completion scripts for Bash, Fish and Zsh can be found in respective subd
 
 ```
 usage: nnn [-b key] [-d] [-e] [-H] [-i] [-n] [-o]
-           [-p file] [-s] [-S] [-t] [-v] [-w] [-h] [PATH]
+           [-p file] [-s] [-S] [-t] [-v] [-h] [PATH]
 
 The missing terminal file manager for X.
 
@@ -229,7 +229,6 @@ optional args:
  -S      du mode
  -t      disable dir auto-select
  -v      show version
- -w      wild load
  -h      show help
 ```
 
@@ -262,8 +261,8 @@ Press <kbd>?</kbd> in `nnn` to see the list anytime.
            ^F  Extract archive   F  List archive
             e  Edit in EDITOR    p  Open in PAGER
  ORDER TOGGLES
-           ^J  du      E  Extn   S  Apparent du
-           ^W  Random  s  Size   t  Time modified
+           ^J  du                S  Apparent du
+            s  Size    E  Extn   t  Time modified
  MISC
          ! ^]  Shell   L  Lock   C  Execute entry
          R ^V  Pick plugin      xK  Run plugin key K
@@ -374,8 +373,6 @@ When there's a unique match and it's a directory, `nnn` auto selects the directo
 
 This mode takes navigation to the next level when short, unique keypress sequences are possible. For example, to reach `nnn` development directory (located at `~/GitHub/nnn`) from my `$HOME` (which is the default directory the terminal starts in), I use the sequence <kbd>g</kbd><kbd>n</kbd>.
 
-The **_wild load_** option can be extremely handy for users who use this mode constantly. The entries are unsorted when the directory loads. Applying filters sorts the entries (with directories on top). Directory color is disabled in this mode.
-
 #### File indicators
 
 The following indicators are used in the detail view:
index cb5f12e1dfeea0073191e72b8d00009ba86d7904..cf5908400ed9799be344b2e2c712b01d6d50376a 100644 (file)
@@ -23,7 +23,6 @@ _nnn () {
         -S
         -t
         -v
-        -w
         -h
     )
     if [[ $prev == -b ]]; then
index a53478f2036f337757abeed817e9a4bea167c935..5ec9cd58490defef530f0f65138ace6bce8a5d80 100644 (file)
@@ -17,5 +17,4 @@ complete -c nnn -s s    -d 'use substring match for filters'
 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 'show program version and exit'
-complete -c nnn -s w    -d 'wild load'
 complete -c nnn -s h    -d 'show program help'
index 269bd8f1df05ebd59b5d3e659189221116e386a5..3bb3ff8aa14ff772471331f97a159f5fb395cc9f 100644 (file)
@@ -21,7 +21,6 @@ args=(
     '(-S)-S[start in disk usage analyzer mode]'
     '(-t)-t[disable dir auto-select]'
     '(-v)-v[show program version and exit]'
-    '(-w)-w[wild load]'
     '(-h)-h[show program help]'
     '*:filename:_files'
 )
diff --git a/nnn.1 b/nnn.1
index a620d082f22f06fdf66768214a073d80d9fa7c0b..86af37880041305bebad0992b9ee5a45b77cee74 100644 (file)
--- a/nnn.1
+++ b/nnn.1
@@ -16,7 +16,6 @@
 .Op Ar -s
 .Op Ar -S
 .Op Ar -v
-.Op Ar -w
 .Op Ar -h
 .Op Ar PATH
 .Sh DESCRIPTION
@@ -73,9 +72,6 @@ supports the following options:
 .Fl v
         show version and exit
 .Pp
-.Fl w
-        wild load - entries unsorted on directory load
-.Pp
 .Fl h
         show program help and exit
 .Sh CONFIGURATION
@@ -124,8 +120,6 @@ In the \fInavigate-as-you-type\fR mode directories are opened in filter mode,
 allowing continuous navigation. Works best with the \fBarrow keys\fR.
 .br
 When there's a unique match and it's a directory, `nnn` auto selects the directory and enters it in this mode.
-.br
-The \fIwild load\fR option can be extremely handy for users who use the \fInavigate-as-you-type\fR mode constantly. The entries are unsorted when the directory loads. Applying filters sorts the entries (with directories on top). Directory color is disabled in this mode.
 .Sh SELECTION
 Use \fI^K\fR to select the file under the cursor.
 .Pp
index 6a4840d3e8654629af5758de227845c285b2fa89..3458c224cd53483b5aa2378c2814cc07c0ee4c94 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -215,7 +215,7 @@ typedef struct {
        uint copymode   : 1;  /* Set when copying files */
        uint showdetail : 1;  /* Clear to show fewer file info */
        uint ctxactive  : 1;  /* Context active or not */
-       uint reserved   : 7;
+       uint reserved   : 8;
        /* The following settings are global */
        uint curctx     : 2;  /* Current context number */
        uint dircolor   : 1;  /* Current status of dir color */
@@ -228,7 +228,6 @@ typedef struct {
        uint runplugin  : 1;  /* Choose plugin mode */
        uint runctx     : 2;  /* The context in which plugin is to be run */
        uint filter_re  : 1;  /* Use regex filters */
-       uint wild       : 1;  /* Do not sort entries on dir load */
        uint trash      : 1;  /* Move removed files to trash */
 } settings;
 
@@ -268,7 +267,6 @@ static settings cfg = {
        0, /* runplugin */
        0, /* runctx */
        1, /* filter_re */
-       0, /* wild */
        0, /* trash */
 };
 
@@ -2843,8 +2841,8 @@ static bool show_help(const char *path)
                 "b^F  Extract archive   F  List archive\n"
                  "ce  Edit in EDITOR    p  Open in PAGER\n"
                "1ORDER TOGGLES\n"
-                "b^J  du      E  Extn   S  Apparent du\n"
-                "b^W  Random  s  Size   t  Time modified\n"
+                "b^J  du                S  Apparent du\n"
+                 "cs  Size    E  Extn   t  Time modified\n"
                "1MISC\n"
               "9! ^]  Shell   L  Lock   C  Execute entry\n"
               "9R ^V  Pick plugin      xK  Run plugin key K\n"
@@ -3167,8 +3165,7 @@ static void populate(char *path, char *lastname)
        if (!ndents)
                return;
 
-       if (!cfg.wild)
-               qsort(dents, ndents, sizeof(*dents), entrycmp);
+       qsort(dents, ndents, sizeof(*dents), entrycmp);
 
 #ifdef DBGMODE
        clock_gettime(CLOCK_REALTIME, &ts2);
@@ -3285,10 +3282,8 @@ static void redraw(char *path)
        } else
                ncols -= 5;
 
-       if (!cfg.wild) {
-               attron(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
-               cfg.dircolor = 1;
-       }
+       attron(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
+       cfg.dircolor = 1;
 
        /* Print listing */
        for (i = curscroll; i < ndents && i < curscroll + onscreen; ++i) {
@@ -3841,8 +3836,7 @@ nochange:
                case SEL_ASIZE: // fallthrough
                case SEL_BSIZE: // fallthrough
                case SEL_EXTN: // fallthrough
-               case SEL_MTIME: // fallthrough
-               case SEL_WILD:
+               case SEL_MTIME:
                        switch (sel) {
                        case SEL_MFLTR:
                                cfg.filtermode ^= 1;
@@ -3869,7 +3863,6 @@ nochange:
                                cfg.blkorder = 0;
                                cfg.extnorder = 0;
                                cfg.copymode = 0;
-                               cfg.wild = 0;
                                break;
                        case SEL_ASIZE:
                                cfg.apparentsz ^= 1;
@@ -3896,7 +3889,6 @@ nochange:
                                cfg.sizeorder = 0;
                                cfg.extnorder = 0;
                                cfg.copymode = 0;
-                               cfg.wild = 0;
                                break;
                        case SEL_EXTN:
                                cfg.extnorder ^= 1;
@@ -3905,27 +3897,15 @@ nochange:
                                cfg.apparentsz = 0;
                                cfg.blkorder = 0;
                                cfg.copymode = 0;
-                               cfg.wild = 0;
                                break;
-                       case SEL_MTIME:
+                       default: /* SEL_MTIME */
                                cfg.mtimeorder ^= 1;
                                cfg.sizeorder = 0;
                                cfg.apparentsz = 0;
                                cfg.blkorder = 0;
                                cfg.extnorder = 0;
                                cfg.copymode = 0;
-                               cfg.wild = 0;
                                break;
-                       default: /* SEL_WILD */
-                               cfg.wild ^= 1;
-                               cfg.mtimeorder = 0;
-                               cfg.sizeorder = 0;
-                               cfg.apparentsz = 0;
-                               cfg.blkorder = 0;
-                               cfg.extnorder = 0;
-                               cfg.copymode = 0;
-                               setdirwatch();
-                               goto nochange;
                        }
 
                        /* Save current */
@@ -4577,7 +4557,7 @@ static void usage(void)
 {
        fprintf(stdout,
                "%s: nnn [-b key] [-d] [-e] [-H] [-i] [-n] [-o]\n"
-               "           [-p file] [-s] [-S] [-t] [-v] [-w] [-h] [PATH]\n\n"
+               "           [-p file] [-s] [-S] [-t] [-v] [-h] [PATH]\n\n"
                "The missing terminal file manager for X.\n\n"
                "positional args:\n"
                "  PATH   start dir [default: current dir]\n\n"
@@ -4594,7 +4574,6 @@ static void usage(void)
                " -S      du mode\n"
                " -t      disable dir auto-select\n"
                " -v      show version\n"
-               " -w      wild load\n"
                " -h      show help\n\n"
                "v%s\n%s\n", __func__, VERSION, GENERAL_INFO);
 }
@@ -4725,7 +4704,7 @@ int main(int argc, char *argv[])
        char *arg = NULL;
        int opt;
 
-       while ((opt = getopt(argc, argv, "HSib:denop:stvwh")) != -1) {
+       while ((opt = getopt(argc, argv, "HSib:denop:stvh")) != -1) {
                switch (opt) {
                case 'S':
                        cfg.blkorder = 1;
@@ -4781,9 +4760,6 @@ int main(int argc, char *argv[])
                case 'v':
                        fprintf(stdout, "%s\n", VERSION);
                        return _SUCCESS;
-               case 'w':
-                       cfg.wild = 1;
-                       break;
                case 'h':
                        usage();
                        return _SUCCESS;
index 75143741cb944319bf2ffff115a257ee4732bfd8..e236e32e881b34d5e32cb42ce5155d7317c4e2b1 100644 (file)
--- a/src/nnn.h
+++ b/src/nnn.h
@@ -74,7 +74,6 @@ enum action {
        SEL_BSIZE,  /* block size */
        SEL_EXTN,   /* order by extension */
        SEL_MTIME,
-       SEL_WILD,
        SEL_REDRAW,
        SEL_SEL,
        SEL_SELMUL,
@@ -199,8 +198,6 @@ static struct key bindings[] = {
        { 'E',            SEL_EXTN },
        /* Toggle sort by time */
        { 't',            SEL_MTIME },
-       /* Wild load */
-       { CONTROL('W'),   SEL_WILD },
        /* Redraw window */
        { CONTROL('L'),   SEL_REDRAW },
        /* Copy currently selected file path */