aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-01-07 20:08:59 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-01-07 20:08:59 +0530
commit9cded0be0ebd976b5fb57648ac279d0bfbe47a04 (patch)
tree69420cf6093bcf2d006e045c9c992be4ddeeaaf1
parentafb6a7ab0481cdfc9d4d44b2aeaf2778e6a781c8 (diff)
downloadnnn-9cded0be0ebd976b5fb57648ac279d0bfbe47a04.tar.gz
Simplify detail printing
-rw-r--r--nnn.c51
1 files changed, 21 insertions, 30 deletions
diff --git a/nnn.c b/nnn.c
index 76c302d..ce9a9ef 100644
--- a/nnn.c
+++ b/nnn.c
@@ -1345,40 +1345,31 @@ printent_long(struct entry *ent, int sel, uint namecols)
if (sel)
attron(A_REVERSE);
- if (!cfg.blkorder) {
- if (S_ISDIR(ent->mode))
- printw("%s%-16.16s / %s/\n", CURSYM(sel), buf, pname);
- else if (S_ISLNK(ent->mode))
- printw("%s%-16.16s @ %s@\n", CURSYM(sel), buf, pname);
- else if (S_ISSOCK(ent->mode))
- printw("%s%-16.16s = %s=\n", CURSYM(sel), buf, pname);
- else if (S_ISFIFO(ent->mode))
- printw("%s%-16.16s | %s|\n", CURSYM(sel), buf, pname);
- else if (S_ISBLK(ent->mode))
- printw("%s%-16.16s b %s\n", CURSYM(sel), buf, pname);
- else if (S_ISCHR(ent->mode))
- printw("%s%-16.16s c %s\n", CURSYM(sel), buf, pname);
- else if (ent->mode & 0100)
- printw("%s%-16.16s %8.8s* %s*\n", CURSYM(sel), buf, coolsize(ent->size), pname);
- else
- printw("%s%-16.16s %8.8s %s\n", CURSYM(sel), buf, coolsize(ent->size), pname);
- } else {
- if (S_ISDIR(ent->mode))
+ if (S_ISDIR(ent->mode)) {
+ if (cfg.blkorder)
printw("%s%-16.16s %8.8s/ %s/\n", CURSYM(sel), buf, coolsize(ent->blocks << 9), pname);
- else if (S_ISLNK(ent->mode))
- printw("%s%-16.16s @ %s@\n", CURSYM(sel), buf, pname);
- else if (S_ISSOCK(ent->mode))
- printw("%s%-16.16s = %s=\n", CURSYM(sel), buf, pname);
- else if (S_ISFIFO(ent->mode))
- printw("%s%-16.16s | %s|\n", CURSYM(sel), buf, pname);
- else if (S_ISBLK(ent->mode))
- printw("%s%-16.16s b %s\n", CURSYM(sel), buf, pname);
- else if (S_ISCHR(ent->mode))
- printw("%s%-16.16s c %s\n", CURSYM(sel), buf, pname);
- else if (ent->mode & 0100)
+ else
+ printw("%s%-16.16s / %s/\n", CURSYM(sel), buf, pname);
+ } else if (S_ISLNK(ent->mode))
+ printw("%s%-16.16s @ %s@\n", CURSYM(sel), buf, pname);
+ else if (S_ISSOCK(ent->mode))
+ printw("%s%-16.16s = %s=\n", CURSYM(sel), buf, pname);
+ else if (S_ISFIFO(ent->mode))
+ printw("%s%-16.16s | %s|\n", CURSYM(sel), buf, pname);
+ else if (S_ISBLK(ent->mode))
+ printw("%s%-16.16s b %s\n", CURSYM(sel), buf, pname);
+ else if (S_ISCHR(ent->mode))
+ printw("%s%-16.16s c %s\n", CURSYM(sel), buf, pname);
+ else if (ent->mode & 0100) {
+ if (cfg.blkorder)
printw("%s%-16.16s %8.8s* %s*\n", CURSYM(sel), buf, coolsize(ent->blocks << 9), pname);
else
+ printw("%s%-16.16s %8.8s* %s*\n", CURSYM(sel), buf, coolsize(ent->size), pname);
+ } else {
+ if (cfg.blkorder)
printw("%s%-16.16s %8.8s %s\n", CURSYM(sel), buf, coolsize(ent->blocks << 9), pname);
+ else
+ printw("%s%-16.16s %8.8s %s\n", CURSYM(sel), buf, coolsize(ent->size), pname);
}
if (sel)