Set dir to bold only if required

This commit is contained in:
Arun Prakash Jana 2020-08-05 13:12:11 +05:30
parent b1ff36eb05
commit 13ccf25551
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -3438,12 +3438,14 @@ static void printent(const struct entry *ent, uint namecols, bool sel)
break; break;
case S_IFDIR: case S_IFDIR:
pair = C_DIR; pair = C_DIR;
attrs |= A_BOLD; if (!g_state.ctxcolor)
attrs |= A_BOLD;
ind = '/'; ind = '/';
break; break;
case S_IFLNK: case S_IFLNK:
if (ent->flags & DIR_OR_LINK_TO_DIR) { if (ent->flags & DIR_OR_LINK_TO_DIR) {
attrs |= A_BOLD; if (!g_state.ctxcolor)
attrs |= A_BOLD;
ind = '/'; ind = '/';
} else } else
ind = '@'; ind = '@';
@ -3536,7 +3538,8 @@ static void printent_long(const struct entry *ent, uint namecols, bool sel)
switch (ent->mode & S_IFMT) { switch (ent->mode & S_IFMT) {
case S_IFDIR: case S_IFDIR:
pair = C_DIR; pair = C_DIR;
attrs |= A_BOLD; if (!g_state.ctxcolor)
attrs |= A_BOLD;
ind2 = '/'; // fallthrough ind2 = '/'; // fallthrough
case S_IFREG: case S_IFREG:
if (!ind2) { if (!ind2) {
@ -3570,7 +3573,7 @@ static void printent_long(const struct entry *ent, uint namecols, bool sel)
pair = (ent->flags & SYM_ORPHAN) ? C_ORP : C_LNK; pair = (ent->flags & SYM_ORPHAN) ? C_ORP : C_LNK;
ind1 = '@'; ind1 = '@';
ind2 = (ent->flags & DIR_OR_LINK_TO_DIR) ? '/' : '@'; ind2 = (ent->flags & DIR_OR_LINK_TO_DIR) ? '/' : '@';
if (ind2 == '/') if (ind2 == '/' && !g_state.ctxcolor)
attrs |= A_BOLD; // fallthrough attrs |= A_BOLD; // fallthrough
case S_IFSOCK: case S_IFSOCK:
if (!ind1) { if (!ind1) {