From eb12354ce4453fb1c6f1dd106edbc0967896a590 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Fri, 31 Mar 2017 19:32:59 +0530 Subject: [PATCH] Show indicator with filename in bar --- nnn.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/nnn.c b/nnn.c index 57ed6e67..b4415ab4 100644 --- a/nnn.c +++ b/nnn.c @@ -641,7 +641,24 @@ redraw(char *path) if (showdetail) { if (ndents) { - sprintf(cwd, "%d items [%s]", ndents, dents[cur].name); + static char ind; + ind = '\0'; + + if (S_ISDIR(dents[cur].mode)) + ind = '/'; + else if (S_ISLNK(dents[cur].mode)) + ind = '@'; + else if (S_ISSOCK(dents[cur].mode)) + ind = '='; + else if (S_ISFIFO(dents[cur].mode)) + ind = '|'; + else if (dents[cur].mode & S_IXUSR) + ind = '*'; + + ind + ? sprintf(cwd, "%d items [%s%c]", ndents, dents[cur].name, ind) + : sprintf(cwd, "%d items [%s]", ndents, dents[cur].name); + printmsg(cwd); } else printmsg("0 items");