mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Revert "Reduce processing if NNN_COLORS is unset"
This reverts commit b948423a80
.
This commit is contained in:
parent
b948423a80
commit
b3f2e47173
20
src/nnn.c
20
src/nnn.c
|
@ -1586,15 +1586,14 @@ static bool initcurses(void *oldmask)
|
|||
char *colors = getenv(env_cfg[NNN_COLORS]);
|
||||
|
||||
if (colors || !getenv("NO_COLOR")) {
|
||||
uint *pclr;
|
||||
uint *pcode;
|
||||
char ch;
|
||||
bool ext = FALSE;
|
||||
|
||||
start_color();
|
||||
use_default_colors();
|
||||
|
||||
if (colors) {
|
||||
if (*colors == '#') {
|
||||
if (colors && *colors == '#') {
|
||||
char *sep = strchr(colors, ';');
|
||||
|
||||
if (COLORS >= 256) {
|
||||
|
@ -1617,25 +1616,24 @@ static bool initcurses(void *oldmask)
|
|||
|
||||
/* Get and set the context colors */
|
||||
for (uchar i = 0; i < CTX_MAX; ++i) {
|
||||
pclr = &g_ctx[i].color;
|
||||
pcode = &g_ctx[i].color;
|
||||
|
||||
if (*colors) {
|
||||
if (colors && *colors) {
|
||||
if (ext) {
|
||||
ch = *colors;
|
||||
if (*++colors) {
|
||||
*pclr = (16 * xchartohex(ch)) + xchartohex(*colors);
|
||||
*pcode = (16 * xchartohex(ch)) + xchartohex(*colors);
|
||||
++colors;
|
||||
} else
|
||||
*pclr = xchartohex(ch);
|
||||
*pcode = xchartohex(ch);
|
||||
} else {
|
||||
*pclr = (*colors < '0' || *colors > '7') ? 4 : *colors - '0';
|
||||
*pcode = (*colors < '0' || *colors > '7') ? 4 : *colors - '0';
|
||||
++colors;
|
||||
}
|
||||
} else
|
||||
*pclr = 4;
|
||||
*pcode = 4;
|
||||
|
||||
init_pair(i + 1, *pclr, -1);
|
||||
}
|
||||
init_pair(i + 1, *pcode, -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue