aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-03-31 19:32:59 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-03-31 19:32:59 +0530
commiteb12354ce4453fb1c6f1dd106edbc0967896a590 (patch)
tree27e6a03b8f30064700b6a32f05ed8484791e3e6d
parentc037f0c55bb56677e68f3331870aaef3dfd99159 (diff)
downloadnnn-eb12354ce4453fb1c6f1dd106edbc0967896a590.tar.gz
Show indicator with filename in bar
-rw-r--r--nnn.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/nnn.c b/nnn.c
index 57ed6e6..b4415ab 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");