diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2019-08-16 23:40:43 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2019-08-16 23:40:43 +0530 |
commit | ac815c692a6ff6923f3943345145a82cf1306e4b (patch) | |
tree | df438c7c00ae3be2c2e50eef070c514afd9ea8ad /src/nnn.c | |
parent | e13481c5b0336ad62d9c72f06467b82673ac522c (diff) | |
download | nnn-ac815c692a6ff6923f3943345145a82cf1306e4b.tar.gz |
Option -o replaces NNN_RESTRICT_NAV_OPEN
Diffstat (limited to 'src/nnn.c')
-rw-r--r-- | src/nnn.c | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -405,10 +405,9 @@ static const char * const messages[] = { #define NNNLVL 6 /* strings end here */ #define NNN_USE_EDITOR 7 /* flags begin here */ #define NNN_NO_AUTOSELECT 8 -#define NNN_RESTRICT_NAV_OPEN 9 -#define NNN_TRASH 10 +#define NNN_TRASH 9 #ifdef __linux__ -#define NNN_OPS_PROG 11 +#define NNN_OPS_PROG 10 #endif static const char * const env_cfg[] = { @@ -421,7 +420,6 @@ static const char * const env_cfg[] = { "NNNLVL", "NNN_USE_EDITOR", "NNN_NO_AUTOSELECT", - "NNN_RESTRICT_NAV_OPEN", "NNN_TRASH", #ifdef __linux__ "NNN_OPS_PROG", @@ -4576,7 +4574,7 @@ nochange: static void usage(void) { fprintf(stdout, - "%s: nnn [-b key] [-d] [-e] [-H] [-i] [-n]\n" + "%s: nnn [-b key] [-d] [-e] [-H] [-i] [-n] [-o]\n" " [-p file] [-s] [-S] [-v] [-w] [-h] [PATH]\n\n" "The missing terminal file manager for X.\n\n" "positional args:\n" @@ -4588,6 +4586,7 @@ static void usage(void) " -H show hidden files\n" " -i nav-as-you-type mode\n" " -n version sort\n" + " -o press Enter to open files\n" " -p file selection file (stdout if '-')\n" " -s string filters [default: regex]\n" " -S du mode\n" @@ -4723,7 +4722,7 @@ int main(int argc, char *argv[]) char *arg = NULL; int opt; - while ((opt = getopt(argc, argv, "HSib:denp:svwh")) != -1) { + while ((opt = getopt(argc, argv, "HSib:denop:svwh")) != -1) { switch (opt) { case 'S': cfg.blkorder = 1; @@ -4749,6 +4748,9 @@ int main(int argc, char *argv[]) case 'n': cmpfn = &xstrverscasecmp; break; + case 'o': + cfg.nonavopen = 1; + break; case 'p': cfg.picker = 1; if (optarg[0] == '-' && optarg[1] == '\0') @@ -4936,10 +4938,6 @@ int main(int argc, char *argv[]) if (xgetenv_set(env_cfg[NNN_NO_AUTOSELECT])) cfg.autoselect = 0; - /* Disable opening files on right arrow and `l` */ - if (xgetenv_set(env_cfg[NNN_RESTRICT_NAV_OPEN])) - cfg.nonavopen = 1; - #ifdef __linux__ if (!xgetenv_set(env_cfg[NNN_OPS_PROG])) { cp[5] = cp[4]; |