mirror of
https://github.com/jarun/nnn.git
synced 2024-12-01 02:49:44 +00:00
Adjusting number of cols is redundant with shortening.
This commit is contained in:
parent
1e5a0b8c5b
commit
dcc9b62760
16
nnn.c
16
nnn.c
|
@ -1198,15 +1198,9 @@ unescape(const char *str, uint maxcols)
|
||||||
static void
|
static void
|
||||||
printent(struct entry *ent, int sel)
|
printent(struct entry *ent, int sel)
|
||||||
{
|
{
|
||||||
static int ncols;
|
|
||||||
static char *pname;
|
static char *pname;
|
||||||
|
|
||||||
if (PATH_MAX + 16 < COLS)
|
pname = unescape(ent->name, COLS - 5);
|
||||||
ncols = PATH_MAX + 16;
|
|
||||||
else
|
|
||||||
ncols = COLS;
|
|
||||||
|
|
||||||
pname = unescape(ent->name, ncols - 5);
|
|
||||||
|
|
||||||
if (S_ISDIR(ent->mode))
|
if (S_ISDIR(ent->mode))
|
||||||
printw("%s%s/\n", CURSYM(sel), pname);
|
printw("%s%s/\n", CURSYM(sel), pname);
|
||||||
|
@ -1255,16 +1249,10 @@ coolsize(off_t size)
|
||||||
static void
|
static void
|
||||||
printent_long(struct entry *ent, int sel)
|
printent_long(struct entry *ent, int sel)
|
||||||
{
|
{
|
||||||
static int ncols;
|
|
||||||
static char buf[18], *pname;
|
static char buf[18], *pname;
|
||||||
|
|
||||||
if (PATH_MAX + 32 < COLS)
|
|
||||||
ncols = PATH_MAX + 32;
|
|
||||||
else
|
|
||||||
ncols = COLS;
|
|
||||||
|
|
||||||
strftime(buf, 18, "%d-%m-%Y %H:%M", localtime(&ent->t));
|
strftime(buf, 18, "%d-%m-%Y %H:%M", localtime(&ent->t));
|
||||||
pname = unescape(ent->name, ncols - 32);
|
pname = unescape(ent->name, COLS - 32);
|
||||||
|
|
||||||
if (sel)
|
if (sel)
|
||||||
attron(A_REVERSE);
|
attron(A_REVERSE);
|
||||||
|
|
Loading…
Reference in a new issue