mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Simplify detail printing
This commit is contained in:
parent
afb6a7ab04
commit
9cded0be0e
33
nnn.c
33
nnn.c
|
@ -1345,27 +1345,12 @@ printent_long(struct entry *ent, int sel, uint namecols)
|
||||||
if (sel)
|
if (sel)
|
||||||
attron(A_REVERSE);
|
attron(A_REVERSE);
|
||||||
|
|
||||||
if (!cfg.blkorder) {
|
if (S_ISDIR(ent->mode)) {
|
||||||
if (S_ISDIR(ent->mode))
|
if (cfg.blkorder)
|
||||||
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))
|
|
||||||
printw("%s%-16.16s %8.8s/ %s/\n", CURSYM(sel), buf, coolsize(ent->blocks << 9), pname);
|
printw("%s%-16.16s %8.8s/ %s/\n", CURSYM(sel), buf, coolsize(ent->blocks << 9), pname);
|
||||||
else if (S_ISLNK(ent->mode))
|
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);
|
printw("%s%-16.16s @ %s@\n", CURSYM(sel), buf, pname);
|
||||||
else if (S_ISSOCK(ent->mode))
|
else if (S_ISSOCK(ent->mode))
|
||||||
printw("%s%-16.16s = %s=\n", CURSYM(sel), buf, pname);
|
printw("%s%-16.16s = %s=\n", CURSYM(sel), buf, pname);
|
||||||
|
@ -1375,10 +1360,16 @@ printent_long(struct entry *ent, int sel, uint namecols)
|
||||||
printw("%s%-16.16s b %s\n", CURSYM(sel), buf, pname);
|
printw("%s%-16.16s b %s\n", CURSYM(sel), buf, pname);
|
||||||
else if (S_ISCHR(ent->mode))
|
else if (S_ISCHR(ent->mode))
|
||||||
printw("%s%-16.16s c %s\n", CURSYM(sel), buf, pname);
|
printw("%s%-16.16s c %s\n", CURSYM(sel), buf, pname);
|
||||||
else if (ent->mode & 0100)
|
else if (ent->mode & 0100) {
|
||||||
|
if (cfg.blkorder)
|
||||||
printw("%s%-16.16s %8.8s* %s*\n", CURSYM(sel), buf, coolsize(ent->blocks << 9), pname);
|
printw("%s%-16.16s %8.8s* %s*\n", CURSYM(sel), buf, coolsize(ent->blocks << 9), pname);
|
||||||
else
|
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);
|
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)
|
if (sel)
|
||||||
|
|
Loading…
Reference in a new issue