aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-01-10 20:15:50 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-01-10 20:15:50 +0530
commitca0a7b0558df7d8685f267ae84424237071f51b2 (patch)
treea982dd2998d93f41be8c05db6a7fae98cf5a2357 /src
parentf04769f5a5bfcecdbe4716413156a614728a8d2b (diff)
downloadnnn-ca0a7b0558df7d8685f267ae84424237071f51b2.tar.gz
Simplify showing status bar symbols
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/nnn.c b/src/nnn.c
index b0dd95f..a1526cf 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4219,9 +4219,11 @@ static void redraw(char *path)
}
if (ndents) {
- char sort[] = "\0 \0\0";
+ char sort[] = "\0\0\0\0";
pEntry pent = &dents[cur];
+ i = 0;
+
if (cfg.mtimeorder)
sort[0] = cfg.mtime ? 'T' : 'A';
else if (cfg.sizeorder)
@@ -4229,18 +4231,22 @@ static void redraw(char *path)
else if (cfg.extnorder)
sort[0] = 'E';
- if (entrycmpfn == &reventrycmp)
- sort[0] ? (sort[1] = 'R', sort[2] = ' ') : (sort[0] = 'R');
+ if (sort[i])
+ ++i;
+
+ if (entrycmpfn == &reventrycmp) {
+ sort[i] = 'R';
+ ++i;
+ }
if (namecmpfn == &xstrverscasecmp) {
- if (!sort[0])
- sort[0] = 'V';
- else if (sort[1] == ' ')
- sort[1] = 'V', sort[2] = ' ';
- else
- sort[2] = 'V', sort[3] = ' ';
+ sort[i] = 'V';
+ ++i;
}
+ if (i)
+ sort[i] = ' ';
+
/* Get the file extension for regular files */
if (S_ISREG(pent->mode)) {
i = (int)(pent->nlen - 1);