mirror of
https://github.com/jarun/nnn.git
synced 2025-02-26 03:01:32 +00:00
Minor refactor
This commit is contained in:
parent
a8da9979b7
commit
0b66191dd5
1 changed files with 5 additions and 6 deletions
11
src/nnn.c
11
src/nnn.c
|
@ -4897,10 +4897,8 @@ static void statusbar(char *path)
|
||||||
if (S_ISREG(pent->mode)) {
|
if (S_ISREG(pent->mode)) {
|
||||||
i = (int)(pent->nlen - 1);
|
i = (int)(pent->nlen - 1);
|
||||||
ptr = xmemrchr((uchar *)pent->name, '.', i);
|
ptr = xmemrchr((uchar *)pent->name, '.', i);
|
||||||
if (ptr) {
|
if (ptr)
|
||||||
extnlen = ptr - pent->name;
|
extnlen = i - (ptr - pent->name);
|
||||||
extnlen = i - extnlen;
|
|
||||||
}
|
|
||||||
if (!ptr || extnlen > 5 || extnlen < 2)
|
if (!ptr || extnlen > 5 || extnlen < 2)
|
||||||
ptr = "\b";
|
ptr = "\b";
|
||||||
} else
|
} else
|
||||||
|
@ -4924,7 +4922,7 @@ static void statusbar(char *path)
|
||||||
|
|
||||||
getorderstr(sort);
|
getorderstr(sort);
|
||||||
|
|
||||||
printw("%d/%d [%s:%s] %s\n", cur + 1, ndents, (cfg.selmode ? "s" : ""),
|
printw("%d/%d [%s:%s] %s", cur + 1, ndents, (cfg.selmode ? "s" : ""),
|
||||||
((g_states & STATE_RANGESEL) ? "*" : (nselected ? xitoa(nselected) : "")),
|
((g_states & STATE_RANGESEL) ? "*" : (nselected ? xitoa(nselected) : "")),
|
||||||
sort);
|
sort);
|
||||||
|
|
||||||
|
@ -4937,6 +4935,7 @@ static void statusbar(char *path)
|
||||||
addstr(coolsize(pent->size));
|
addstr(coolsize(pent->size));
|
||||||
addch(' ');
|
addch(' ');
|
||||||
addstr(ptr);
|
addstr(ptr);
|
||||||
|
addch('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
attroff(COLOR_PAIR(cfg.curctx + 1));
|
attroff(COLOR_PAIR(cfg.curctx + 1));
|
||||||
|
@ -5053,7 +5052,7 @@ static void redraw(char *path)
|
||||||
if ((i + MIN_DISPLAY_COLS) <= ncols)
|
if ((i + MIN_DISPLAY_COLS) <= ncols)
|
||||||
addnstr(path, ncols - MIN_DISPLAY_COLS);
|
addnstr(path, ncols - MIN_DISPLAY_COLS);
|
||||||
else {
|
else {
|
||||||
char *base = xbasename(path);
|
char *base = xmemrchr((uchar *)path, '/', i);;
|
||||||
|
|
||||||
if ((base - ptr) <= 1)
|
if ((base - ptr) <= 1)
|
||||||
addnstr(path, ncols - MIN_DISPLAY_COLS);
|
addnstr(path, ncols - MIN_DISPLAY_COLS);
|
||||||
|
|
Loading…
Add table
Reference in a new issue