]> Sergey Matveev's repositories - nnn.git/commitdiff
Support only NO_COLOR, revert -C to disable color
authorArun Prakash Jana <engineerarun@gmail.com>
Sun, 5 Apr 2020 07:34:14 +0000 (13:04 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 5 Apr 2020 07:37:18 +0000 (13:07 +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 3614e2889634923903ac3b772da501a3dcca5969..b498b63147c3d2bcfb40da45c301b40f7b483d49 100644 (file)
@@ -15,7 +15,6 @@ _nnn ()
         -A
         -b
         -c
-        -C
         -d
         -e
         -E
index 9dc05f119c5ba6ca28655fe68932c7c32c881fdb..82dfc36feebd9aa2ba571432af0a6f08a2dda38e 100644 (file)
@@ -14,7 +14,6 @@ end
 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 C    -d 'disable color'
 complete -c nnn -s d    -d 'start in detail mode'
 complete -c nnn -s e    -d 'open text files in $VISUAL/$EDITOR/vi'
 complete -c nnn -s E    -d 'use EDITOR for undetached edits'
index 6da9dea8b8554951d86e8da36fc74f8a5a765915..d40ea684aec425a824be9bb28741d3550bce73ce 100644 (file)
@@ -12,7 +12,6 @@ args=(
     '(-A)-A[disable dir auto-select]'
     '(-b)-b[bookmark key to open]:key char'
     '(-c)-c[cli-only opener]'
-    '(-C)-C[disable color]'
     '(-d)-d[start in detail mode]'
     '(-e)-e[open text files in $VISUAL/$EDITOR/vi]'
     '(-E)-E[use EDITOR for undetached edits]'
diff --git a/nnn.1 b/nnn.1
index b7dcf02cac055766de6d567e1e600e4895fe79c1..ab8ae046ce9b389aca3c7588f2a683fc689459cd 100644 (file)
--- a/nnn.1
+++ b/nnn.1
@@ -9,7 +9,6 @@
 .Op Ar -A
 .Op Ar -b key
 .Op Ar -c
-.Op Ar -C
 .Op Ar -d
 .Op Ar -e
 .Op Ar -E
@@ -63,9 +62,6 @@ supports the following options:
 .Fl c
         opener opens files in cli utilities only (overrides -e)
 .Pp
-.Fl C
-        disable color
-.Pp
 .Fl d
         detail mode
 .Pp
index 6e553894c8b8097b299258cee3737fc1674600b9..d5421695d56cfd99118186bf6944213f2ef43b56 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -400,7 +400,6 @@ static char g_pipepath[TMP_LEN_MAX] __attribute__ ((aligned));
 #define STATE_TRASH 0x40
 #define STATE_FORCEQUIT 0x80
 #define STATE_FORTUNE 0x100
-#define STATE_NOCOLOR 0x200
 
 static uint g_states;
 
@@ -1489,9 +1488,6 @@ static void export_file_list(void)
 /* Initialize curses mode */
 static bool initcurses(void *oldmask)
 {
-       short i;
-       char *colors = xgetenv(env_cfg[NNN_COLORS], "4444");
-
 #ifdef NOMOUSE
        (void) oldmask;
 #endif
@@ -1524,7 +1520,10 @@ static bool initcurses(void *oldmask)
 #endif
        curs_set(FALSE); /* Hide cursor */
 
-       if (!(g_states & STATE_NOCOLOR || getenv("NO_COLOR"))) {
+       if (!getenv("NO_COLOR")) {
+               short i;
+               char *colors = xgetenv(env_cfg[NNN_COLORS], "4444");
+
                start_color();
                use_default_colors();
 
@@ -6588,7 +6587,6 @@ static void usage(void)
                " -A      no dir auto-select\n"
                " -b key  open bookmark key\n"
                " -c      cli-only opener (overrides -e)\n"
-               " -C      disable color\n"
                " -d      detail mode\n"
                " -e      text in $VISUAL/$EDITOR/vi\n"
                " -E      use EDITOR for undetached edits\n"
@@ -6760,7 +6758,7 @@ int main(int argc, char *argv[])
 
        while ((opt = (env_opts_id > 0
                       ? env_opts[--env_opts_id]
-                      : getopt(argc, argv, "Ab:cCdeEfFgHKnop:QrRs:St:T:Vxh"))) != -1) {
+                      : getopt(argc, argv, "Ab:cdeEfFgHKnop:QrRs:St:T:Vxh"))) != -1) {
                switch (opt) {
                case 'A':
                        cfg.autoselect = 0;
@@ -6771,9 +6769,6 @@ int main(int argc, char *argv[])
                case 'c':
                        cfg.cliopener = 1;
                        break;
-               case 'C':
-                       g_states |= STATE_NOCOLOR;
-                       break;
                case 'S':
                        cfg.blkorder = 1;
                        nftw_fn = sum_bsize;