mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Simplify showing status bar symbols
This commit is contained in:
parent
f04769f5a5
commit
ca0a7b0558
24
src/nnn.c
24
src/nnn.c
|
@ -4219,9 +4219,11 @@ static void redraw(char *path)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ndents) {
|
if (ndents) {
|
||||||
char sort[] = "\0 \0\0";
|
char sort[] = "\0\0\0\0";
|
||||||
pEntry pent = &dents[cur];
|
pEntry pent = &dents[cur];
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
|
||||||
if (cfg.mtimeorder)
|
if (cfg.mtimeorder)
|
||||||
sort[0] = cfg.mtime ? 'T' : 'A';
|
sort[0] = cfg.mtime ? 'T' : 'A';
|
||||||
else if (cfg.sizeorder)
|
else if (cfg.sizeorder)
|
||||||
|
@ -4229,18 +4231,22 @@ static void redraw(char *path)
|
||||||
else if (cfg.extnorder)
|
else if (cfg.extnorder)
|
||||||
sort[0] = 'E';
|
sort[0] = 'E';
|
||||||
|
|
||||||
if (entrycmpfn == &reventrycmp)
|
if (sort[i])
|
||||||
sort[0] ? (sort[1] = 'R', sort[2] = ' ') : (sort[0] = 'R');
|
++i;
|
||||||
|
|
||||||
|
if (entrycmpfn == &reventrycmp) {
|
||||||
|
sort[i] = 'R';
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
|
||||||
if (namecmpfn == &xstrverscasecmp) {
|
if (namecmpfn == &xstrverscasecmp) {
|
||||||
if (!sort[0])
|
sort[i] = 'V';
|
||||||
sort[0] = 'V';
|
++i;
|
||||||
else if (sort[1] == ' ')
|
|
||||||
sort[1] = 'V', sort[2] = ' ';
|
|
||||||
else
|
|
||||||
sort[2] = 'V', sort[3] = ' ';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i)
|
||||||
|
sort[i] = ' ';
|
||||||
|
|
||||||
/* Get the file extension for regular files */
|
/* Get the file extension for regular files */
|
||||||
if (S_ISREG(pent->mode)) {
|
if (S_ISREG(pent->mode)) {
|
||||||
i = (int)(pent->nlen - 1);
|
i = (int)(pent->nlen - 1);
|
||||||
|
|
Loading…
Reference in a new issue