aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Georgi Kirilov <kirilov.georgi.s@gmail.com>2019-02-01 07:33:11 +0200
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-02-01 19:51:19 +0530
commite5dc6c8750fd7400cded9fe7daaf56d2ca0d9461 (patch)
tree88dea8528b820f94a481b032e9bb0d3b5076c021
parenta85268cf79fb0b47d9b090d027305be3e264fe61 (diff)
downloadnnn-e5dc6c8750fd7400cded9fe7daaf56d2ca0d9461.tar.gz
Don't reset dircolor prematurely
-rw-r--r--src/nnn.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 23dbb34..e32a0d9 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1722,9 +1722,9 @@ static char *get_bm_loc(int key, char *buf)
return NULL;
}
-static void resetdircolor(mode_t mode)
+static void resetdircolor(int flags)
{
- if (cfg.dircolor && !S_ISDIR(mode)) {
+ if (cfg.dircolor && !(flags & DIR_OR_LINK_TO_DIR)) {
attroff(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
cfg.dircolor = 0;
}
@@ -1872,7 +1872,7 @@ static void printent(struct entry *ent, int sel, uint namecols)
pname = unescape(ent->name, namecols);
/* Directories are always shown on top */
- resetdircolor(ent->mode);
+ resetdircolor(ent->flags);
printw("%s%s%s\n", CURSYM(sel), pname, get_file_sym(ent->mode));
}
@@ -1885,7 +1885,7 @@ static void printent_long(struct entry *ent, int sel, uint namecols)
pname = unescape(ent->name, namecols);
/* Directories are always shown on top */
- resetdircolor(ent->mode);
+ resetdircolor(ent->flags);
if (sel)
attron(A_REVERSE);