Show indicator with filename in bar

This commit is contained in:
Arun Prakash Jana 2017-03-31 19:32:59 +05:30
parent c037f0c55b
commit eb12354ce4
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 18 additions and 1 deletions

19
nnn.c
View File

@ -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");