nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit b626cfa00f75638bb80e1b447a7455ec1485b162
parent 3e91c2c9772d329d0db98e9a9f5504bee97b7662
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date:   Sat, 19 Jun 2021 20:36:16 +0530

Use macro in all places

Diffstat:
Msrc/nnn.c | 22++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/nnn.c b/src/nnn.c @@ -650,13 +650,14 @@ static const char * const messages[] = { #define NNN_PLUG 2 #define NNN_OPENER 3 #define NNN_COLORS 4 -#define NNNLVL 5 -#define NNN_PIPE 6 -#define NNN_MCLICK 7 -#define NNN_SEL 8 -#define NNN_ARCHIVE 9 -#define NNN_HELP 10 /* strings end here */ -#define NNN_TRASH 11 /* flags begin here */ +#define NNN_FCOLORS 5 +#define NNNLVL 6 +#define NNN_PIPE 7 +#define NNN_MCLICK 8 +#define NNN_SEL 9 +#define NNN_ARCHIVE 10 +#define NNN_HELP 11 /* strings end here */ +#define NNN_TRASH 12 /* flags begin here */ static const char * const env_cfg[] = { "NNN_OPTS", @@ -664,6 +665,7 @@ static const char * const env_cfg[] = { "NNN_PLUG", "NNN_OPENER", "NNN_COLORS", + "NNN_FCOLORS", "NNNLVL", "NNN_PIPE", "NNN_MCLICK", @@ -1789,7 +1791,7 @@ static void export_file_list(void) static bool init_fcolors(void) { - char *f_colors = getenv("NNN_FCOLORS"); + char *f_colors = getenv(env_cfg[NNN_FCOLORS]); if (!f_colors || !*f_colors) f_colors = gcolors; @@ -1856,7 +1858,7 @@ static bool initcurses(void *oldmask) if (COLORS >= 256) { if (!(g_state.oldcolor || init_fcolors())) { exitcurses(); - msg("NNN_FCOLORS!"); + msg(env_cfg[NNN_FCOLORS]); return FALSE; } } else @@ -1897,7 +1899,7 @@ static bool initcurses(void *oldmask) fcolors[i + 1] = *pcode += xchartohex(*colors); else { /* Each color code must be 2 hex symbols */ exitcurses(); - msg("NNN_COLORS!"); + msg(env_cfg[NNN_COLORS]); return FALSE; } } else