]> Sergey Matveev's repositories - nnn.git/commitdiff
File colors is independent of context colors
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 5 Aug 2020 19:36:21 +0000 (01:06 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 5 Aug 2020 19:36:21 +0000 (01:06 +0530)
src/nnn.c

index 6aa13f5b8e4eec747e1fd98b07ae92ecd921f812..6f434e1c7e8b8d1f3571c67380969dad645b94db 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1661,11 +1661,14 @@ static bool initcurses(void *oldmask)
                use_default_colors();
 
                /* Initialize file colors */
-               if (COLORS >= 256 && !(g_state.oldcolor || init_fcolors())) {
-                       exitcurses();
-                       fprintf(stderr, "NNN_FCOLORS!\n");
-                       return FALSE;
-               }
+               if (COLORS >= 256) {
+                       if (!(g_state.oldcolor || init_fcolors())) {
+                               exitcurses();
+                               fprintf(stderr, "NNN_FCOLORS!\n");
+                               return FALSE;
+                       }
+               } else
+                       g_state.oldcolor = 1;
 
                if (colors && *colors == '#') {
                        char *sep = strchr(colors, ';');
@@ -1685,10 +1688,8 @@ static bool initcurses(void *oldmask)
                                colors = sep; /* Detect if 8 colors fallback is appended */
                                if (colors)
                                        ++colors;
-                               g_state.oldcolor = 1;
                        }
-               } else
-                       g_state.oldcolor = 1;
+               }
 
                /* Get and set the context colors */
                for (uchar i = 0; i <  CTX_MAX; ++i) {