uint runplugin : 1; /* Choose plugin mode */
uint runctx : 2; /* The context in which plugin is to be run */
uint selmode : 1; /* Set when selecting files */
- uint ctxcolor : 1; /* Show dirs in context colors */
+ uint oldcolor : 1; /* Show dirs in context colors */
uint reserved : 14;
} runstate;
if (sep)
*sep = '\0';
- if (!(g_state.ctxcolor || init_fcolors())) {
+ if (!(g_state.oldcolor || init_fcolors())) {
exitcurses();
fprintf(stderr, "NNN_FCOLORS!\n");
return FALSE;
colors = sep; /* Detect if 8 colors fallback is appended */
if (colors)
++colors;
- g_state.ctxcolor = 1;
+ g_state.oldcolor = 1;
}
} else
- g_state.ctxcolor = 1;
+ g_state.oldcolor = 1;
/* Get and set the context colors */
for (uchar i = 0; i < CTX_MAX; ++i) {
break;
case S_IFDIR:
pair = C_DIR;
- if (!g_state.ctxcolor)
+ if (!g_state.oldcolor)
attrs |= A_BOLD;
ind = '/';
break;
case S_IFLNK:
if (ent->flags & DIR_OR_LINK_TO_DIR) {
- if (!g_state.ctxcolor)
+ if (!g_state.oldcolor)
attrs |= A_BOLD;
ind = '/';
} else
ind = '@';
- if (g_state.ctxcolor)
+ if (g_state.oldcolor)
attrs |= A_DIM;
else
pair = (ent->flags & SYM_ORPHAN) ? C_ORP : C_LNK;
break;
}
- if (!g_state.ctxcolor) {
+ if (!g_state.oldcolor) {
if (ent->flags & FILE_MISSING)
pair = C_MIS;
bool ln = FALSE;
char ind1 = '\0', ind2 = '\0';
uchar pair = 0;
- int attrs = sel ? A_REVERSE | (g_state.ctxcolor ? A_DIM : COLOR_PAIR(C_MIS))
- : (g_state.ctxcolor ? A_DIM : COLOR_PAIR(C_MIS));
+ int attrs = sel ? A_REVERSE | (g_state.oldcolor ? A_DIM : COLOR_PAIR(C_MIS))
+ : (g_state.oldcolor ? A_DIM : COLOR_PAIR(C_MIS));
uint len;
char *size;
switch (ent->mode & S_IFMT) {
case S_IFDIR:
pair = C_DIR;
- if (!g_state.ctxcolor)
+ if (!g_state.oldcolor)
attrs |= A_BOLD;
ind2 = '/'; // fallthrough
case S_IFREG:
pair = (ent->flags & SYM_ORPHAN) ? C_ORP : C_LNK;
ind1 = '@';
ind2 = (ent->flags & DIR_OR_LINK_TO_DIR) ? '/' : '@';
- if (ind2 == '/' && !g_state.ctxcolor)
+ if (ind2 == '/' && !g_state.oldcolor)
attrs |= A_BOLD; // fallthrough
case S_IFSOCK:
if (!ind1) {
addstr(" ");
- if (g_state.ctxcolor) {
+ if (g_state.oldcolor) {
if (!ln) {
attroff(A_DIM);
attrs ^= A_DIM;
ncols = adjust_cols(ncols);
- if (g_state.ctxcolor && (pdents[last].flags & DIR_OR_LINK_TO_DIR)) {
+ if (g_state.oldcolor && (pdents[last].flags & DIR_OR_LINK_TO_DIR)) {
attron(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
dir = TRUE;
}
move(2 + last - curscroll, 0);
printptr(&pdents[last], ncols, false);
- if (g_state.ctxcolor && (pdents[cur].flags & DIR_OR_LINK_TO_DIR)) {
+ if (g_state.oldcolor && (pdents[cur].flags & DIR_OR_LINK_TO_DIR)) {
if (!dir) {/* First file is not a directory */
attron(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
dir = TRUE;
}
addstr("] "); /* 10 chars printed for contexts - "[1 2 3 4] " */
- attron(A_UNDERLINE);
+ attron(A_UNDERLINE | COLOR_PAIR(cfg.curctx + 1));
/* Print path */
i = (int)xstrlen(path);
addnstr(base, ncols - (MIN_DISPLAY_COLS + i));
}
- attroff(A_UNDERLINE);
+ attroff(A_UNDERLINE | COLOR_PAIR(cfg.curctx + 1));
/* Go to first entry */
move(2, 0);
ncols = adjust_cols(ncols);
- if (g_state.ctxcolor) {
+ if (g_state.oldcolor) {
attron(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
g_state.dircolor = 1;
}
cfg.cliopener = 1;
break;
case 'C':
- g_state.ctxcolor = 1;
+ g_state.oldcolor = 1;
break;
case 'd':
cfg.showdetail = 1;