mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Show file details in file missing colors
This commit is contained in:
parent
13ccf25551
commit
8c2e1726ba
2
nnn.1
2
nnn.1
|
@ -443,7 +443,7 @@ separated by \fI;\fR:
|
||||||
Regular | 00 | Normal
|
Regular | 00 | Normal
|
||||||
Hard link | 60 | Plum4
|
Hard link | 60 | Plum4
|
||||||
Symbolic link | 33 | Cyan1
|
Symbolic link | 33 | Cyan1
|
||||||
Missing | f9 | Grey70
|
Missing OR file details | f7 | Grey62
|
||||||
Orphaned symbolic link | c6 | DeepPink1
|
Orphaned symbolic link | c6 | DeepPink1
|
||||||
FIFO | d6 | Orange1
|
FIFO | d6 | Orange1
|
||||||
Socket | ab | MediumOrchid1
|
Socket | ab | MediumOrchid1
|
||||||
|
|
20
src/nnn.c
20
src/nnn.c
|
@ -677,13 +677,13 @@ static const char * const patterns[] = {
|
||||||
#define C_FIL (C_EXE + 1) /* Regular file: Normal */
|
#define C_FIL (C_EXE + 1) /* Regular file: Normal */
|
||||||
#define C_HRD (C_FIL + 1) /* Hard link: Plum4 */
|
#define C_HRD (C_FIL + 1) /* Hard link: Plum4 */
|
||||||
#define C_LNK (C_HRD + 1) /* Symbolic link: Cyan1 */
|
#define C_LNK (C_HRD + 1) /* Symbolic link: Cyan1 */
|
||||||
#define C_MIS (C_LNK + 1) /* Missing file: Grey70 */
|
#define C_MIS (C_LNK + 1) /* Missing file OR file details: Grey62 */
|
||||||
#define C_ORP (C_MIS + 1) /* Orphaned symlink: DeepPink1 */
|
#define C_ORP (C_MIS + 1) /* Orphaned symlink: DeepPink1 */
|
||||||
#define C_PIP (C_ORP + 1) /* Named pipe (FIFO): Orange1 */
|
#define C_PIP (C_ORP + 1) /* Named pipe (FIFO): Orange1 */
|
||||||
#define C_SOC (C_PIP + 1) /* Socket: MediumOrchid1 */
|
#define C_SOC (C_PIP + 1) /* Socket: MediumOrchid1 */
|
||||||
#define C_UND (C_SOC + 1) /* Unknown OR 0B regular/exe file: Red1 */
|
#define C_UND (C_SOC + 1) /* Unknown OR 0B regular/exe file: Red1 */
|
||||||
|
|
||||||
static char gcolors[] = "c1e2272e006033f9c6d6abc4";
|
static char gcolors[] = "c1e2272e006033f7c6d6abc4";
|
||||||
static uint fcolors[C_UND + 1] = {0};
|
static uint fcolors[C_UND + 1] = {0};
|
||||||
|
|
||||||
/* Event handling */
|
/* Event handling */
|
||||||
|
@ -3513,7 +3513,8 @@ static void printent_long(const struct entry *ent, uint namecols, bool sel)
|
||||||
bool ln = FALSE;
|
bool ln = FALSE;
|
||||||
char ind1 = '\0', ind2 = '\0';
|
char ind1 = '\0', ind2 = '\0';
|
||||||
uchar pair = 0;
|
uchar pair = 0;
|
||||||
int attrs = sel ? A_REVERSE | A_DIM : A_DIM;
|
int attrs = sel ? A_REVERSE | (g_state.ctxcolor ? A_DIM : COLOR_PAIR(C_MIS))
|
||||||
|
: (g_state.ctxcolor ? A_DIM : COLOR_PAIR(C_MIS));
|
||||||
uint len;
|
uint len;
|
||||||
char *size;
|
char *size;
|
||||||
|
|
||||||
|
@ -3606,20 +3607,25 @@ static void printent_long(const struct entry *ent, uint namecols, bool sel)
|
||||||
}
|
}
|
||||||
|
|
||||||
addstr(" ");
|
addstr(" ");
|
||||||
if (!(ln && g_state.ctxcolor)) {
|
|
||||||
|
if (g_state.ctxcolor) {
|
||||||
|
if (!ln) {
|
||||||
attroff(A_DIM);
|
attroff(A_DIM);
|
||||||
attrs ^= A_DIM;
|
attrs ^= A_DIM;
|
||||||
|
}
|
||||||
if (!g_state.ctxcolor) {
|
} else {
|
||||||
if (ent->flags & FILE_MISSING)
|
if (ent->flags & FILE_MISSING)
|
||||||
pair = C_MIS;
|
pair = C_MIS;
|
||||||
|
else {
|
||||||
|
attroff(COLOR_PAIR(C_MIS));
|
||||||
|
attrs ^= (COLOR_PAIR(C_MIS));
|
||||||
|
}
|
||||||
|
|
||||||
if (pair && fcolors[pair]) {
|
if (pair && fcolors[pair]) {
|
||||||
attrs |= COLOR_PAIR(pair);
|
attrs |= COLOR_PAIR(pair);
|
||||||
attron(attrs);
|
attron(attrs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#ifndef NOLOCALE
|
#ifndef NOLOCALE
|
||||||
addwstr(unescape(ent->name, namecols));
|
addwstr(unescape(ent->name, namecols));
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue