]> Sergey Matveev's repositories - nnn.git/commitdiff
Show indicator with filename in bar
authorArun Prakash Jana <engineerarun@gmail.com>
Fri, 31 Mar 2017 14:02:59 +0000 (19:32 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Fri, 31 Mar 2017 14:02:59 +0000 (19:32 +0530)
nnn.c

diff --git a/nnn.c b/nnn.c
index 57ed6e678d27938a1f4eaa75a163c42660d4c10a..b4415ab43de922157fa618dd87fde0303fab64ae 100644 (file)
--- 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");