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 oldcolor : 1; /* Show dirs in context colors */
- uint reserved : 14;
+ uint oldcolor : 1; /* Use older colorscheme */
uint stayonsel : 1; /* Disable auto-proceed on select */
+ uint dirctx : 1; /* Show dirs in context color */
+ uint reserved : 12;
} runstate;
/* Contexts or workspaces */
if (ext) {
*pcode = xchartohex(*colors) << 4;
if (*++colors)
- *pcode += xchartohex(*colors);
+ fcolors[i + 1] = *pcode += xchartohex(*colors);
else { /* Each color code must be 2 hex symbols */
exitcurses();
fprintf(stderr, "NNN_COLORS!\n");
break;
case S_IFDIR:
pair = C_DIR;
- if (!g_state.oldcolor)
+ if (!g_state.oldcolor) {
attrs |= A_BOLD;
+ if (g_state.dirctx)
+ pair = cfg.curctx + 1;
+ }
ind = '/';
break;
case S_IFLNK:
bool ln = FALSE;
char ind1 = '\0', ind2 = '\0';
uchar pair = 0;
- int attrs = sel ? A_REVERSE | (g_state.oldcolor ? 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.oldcolor)
+ if (!g_state.oldcolor) {
attrs |= A_BOLD;
+ if (g_state.dirctx)
+ pair = cfg.curctx + 1;
+ }
ind2 = '/'; // fallthrough
case S_IFREG:
if (!ind2) {
" -c cli-only NNN_OPENER (trumps -e)\n"
" -C earlier colorscheme\n"
" -d detail mode\n"
+ " -D dirs in context color\n"
" -e text in $VISUAL/$EDITOR/vi\n"
" -E use EDITOR for undetached edits\n"
#ifndef NORL
while ((opt = (env_opts_id > 0
? env_opts[--env_opts_id]
- : getopt(argc, argv, "aAb:cCdeEfFgHJKl:nop:P:QrRs:St:T:uVwxh"))) != -1) {
+ : getopt(argc, argv, "aAb:cCdDeEfFgHJKl:nop:P:QrRs:St:T:uVwxh"))) != -1) {
switch (opt) {
#ifndef NOFIFO
case 'a':
cfg.showdetail = 1;
printptr = &printent_long;
break;
+ case 'D':
+ g_state.dirctx = 1;
+ break;
case 'e':
cfg.useeditor = 1;
break;