mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Show sort order if applied
This commit is contained in:
parent
8f18c4049c
commit
6e7aaa18fb
30
nnn.c
30
nnn.c
|
@ -702,25 +702,31 @@ redraw(char *path)
|
||||||
|
|
||||||
if (showdetail) {
|
if (showdetail) {
|
||||||
if (ndents) {
|
if (ndents) {
|
||||||
static char ind;
|
static char ind[2] = "\0\0";
|
||||||
ind = '\0';
|
static char sort[9];
|
||||||
|
|
||||||
|
if (mtimeorder)
|
||||||
|
sprintf(sort, "by time ");
|
||||||
|
else if (sizeorder)
|
||||||
|
sprintf(sort, "by size ");
|
||||||
|
else
|
||||||
|
sort[0] = '\0';
|
||||||
|
|
||||||
if (S_ISDIR(dents[cur].mode))
|
if (S_ISDIR(dents[cur].mode))
|
||||||
ind = '/';
|
ind[0] = '/';
|
||||||
else if (S_ISLNK(dents[cur].mode))
|
else if (S_ISLNK(dents[cur].mode))
|
||||||
ind = '@';
|
ind[0] = '@';
|
||||||
else if (S_ISSOCK(dents[cur].mode))
|
else if (S_ISSOCK(dents[cur].mode))
|
||||||
ind = '=';
|
ind[0] = '=';
|
||||||
else if (S_ISFIFO(dents[cur].mode))
|
else if (S_ISFIFO(dents[cur].mode))
|
||||||
ind = '|';
|
ind[0] = '|';
|
||||||
else if (dents[cur].mode & S_IXUSR)
|
else if (dents[cur].mode & S_IXUSR)
|
||||||
ind = '*';
|
ind[0] = '*';
|
||||||
|
else
|
||||||
ind ? sprintf(cwd, "%d items [%s%c]",
|
ind[0] = '\0';
|
||||||
ndents, dents[cur].name, ind)
|
|
||||||
: sprintf(cwd, "%d items [%s]",
|
|
||||||
ndents, dents[cur].name);
|
|
||||||
|
|
||||||
|
sprintf(cwd, "total %d %s[%s%s]", ndents, sort,
|
||||||
|
dents[cur].name, ind);
|
||||||
printmsg(cwd);
|
printmsg(cwd);
|
||||||
} else
|
} else
|
||||||
printmsg("0 items");
|
printmsg("0 items");
|
||||||
|
|
Loading…
Reference in a new issue