]> Sergey Matveev's repositories - nnn.git/commitdiff
Initialize file type colors as default
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 5 Aug 2020 18:57:12 +0000 (00:27 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 5 Aug 2020 18:57:12 +0000 (00:27 +0530)
src/nnn.c

index da42690c13c056dd1c7fbe0f1629afd22fcb59fe..6aa13f5b8e4eec747e1fd98b07ae92ecd921f812 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1660,6 +1660,13 @@ static bool initcurses(void *oldmask)
                start_color();
                use_default_colors();
 
+               /* Initialize file colors */
+               if (COLORS >= 256 && !(g_state.oldcolor || init_fcolors())) {
+                       exitcurses();
+                       fprintf(stderr, "NNN_FCOLORS!\n");
+                       return FALSE;
+               }
+
                if (colors && *colors == '#') {
                        char *sep = strchr(colors, ';');
 
@@ -1674,12 +1681,6 @@ static bool initcurses(void *oldmask)
                                 */
                                if (sep)
                                        *sep = '\0';
-
-                               if (!(g_state.oldcolor || init_fcolors())) {
-                                       exitcurses();
-                                       fprintf(stderr, "NNN_FCOLORS!\n");
-                                       return FALSE;
-                               }
                        } else {
                                colors = sep; /* Detect if 8 colors fallback is appended */
                                if (colors)