mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Use a shorter width param
This commit is contained in:
parent
a36146f9c0
commit
4a3bf6d40f
21
src/nnn.c
21
src/nnn.c
|
@ -2682,7 +2682,7 @@ static char *get_lsperms(mode_t mode)
|
||||||
return bits;
|
return bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void printent(const struct entry *ent, int sel, uint namecols)
|
static void printent(const struct entry *ent, uint namecols, bool sel)
|
||||||
{
|
{
|
||||||
wchar_t *wstr;
|
wchar_t *wstr;
|
||||||
char ind = '\0';
|
char ind = '\0';
|
||||||
|
@ -2733,7 +2733,7 @@ static void printent(const struct entry *ent, int sel, uint namecols)
|
||||||
attroff(A_REVERSE);
|
attroff(A_REVERSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void printent_long(const struct entry *ent, int sel, uint namecols)
|
static void printent_long(const struct entry *ent, uint namecols, bool sel)
|
||||||
{
|
{
|
||||||
char timebuf[24], permbuf[4], ind1 = '\0', ind2[] = "\0\0";
|
char timebuf[24], permbuf[4], ind1 = '\0', ind2[] = "\0\0";
|
||||||
const char cp = (ent->flags & FILE_SELECTED) ? '+' : ' ';
|
const char cp = (ent->flags & FILE_SELECTED) ? '+' : ' ';
|
||||||
|
@ -2799,7 +2799,7 @@ static void printent_long(const struct entry *ent, int sel, uint namecols)
|
||||||
attroff(A_REVERSE);
|
attroff(A_REVERSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void (*printptr)(const struct entry *ent, int sel, uint namecols) = &printent;
|
static void (*printptr)(const struct entry *ent, uint namecols, bool sel) = &printent;
|
||||||
|
|
||||||
static void savecurctx(settings *curcfg, char *path, char *curname, int r /* next context num */)
|
static void savecurctx(settings *curcfg, char *path, char *curname, int r /* next context num */)
|
||||||
{
|
{
|
||||||
|
@ -4122,20 +4122,15 @@ static void redraw(char *path)
|
||||||
for (i = 0; i < CTX_MAX; ++i) {
|
for (i = 0; i < CTX_MAX; ++i) {
|
||||||
if (!g_ctx[i].c_cfg.ctxactive) {
|
if (!g_ctx[i].c_cfg.ctxactive) {
|
||||||
addch(i + '1');
|
addch(i + '1');
|
||||||
addch(' ');
|
|
||||||
} else {
|
} else {
|
||||||
if (cfg.curctx != i)
|
attrs = (cfg.curctx != i)
|
||||||
/* Underline active contexts */
|
? (COLOR_PAIR(i + 1) | A_BOLD | A_UNDERLINE) /* Underline active */
|
||||||
attrs = COLOR_PAIR(i + 1) | A_BOLD | A_UNDERLINE;
|
: (COLOR_PAIR(i + 1) | A_BOLD | A_REVERSE); /* Current in reverse */
|
||||||
else
|
|
||||||
/* Print current context in reverse */
|
|
||||||
attrs = COLOR_PAIR(i + 1) | A_BOLD | A_REVERSE;
|
|
||||||
|
|
||||||
attron(attrs);
|
attron(attrs);
|
||||||
addch(i + '1');
|
addch(i + '1');
|
||||||
attroff(attrs);
|
attroff(attrs);
|
||||||
addch(' ');
|
|
||||||
}
|
}
|
||||||
|
addch(' ');
|
||||||
}
|
}
|
||||||
addstr("\b] "); /* 10 chars printed for contexts - "[1 2 3 4] " */
|
addstr("\b] "); /* 10 chars printed for contexts - "[1 2 3 4] " */
|
||||||
|
|
||||||
|
@ -4192,7 +4187,7 @@ static void redraw(char *path)
|
||||||
|
|
||||||
/* Print listing */
|
/* Print listing */
|
||||||
for (i = curscroll; i < ndents && i < curscroll + onscreen; ++i)
|
for (i = curscroll; i < ndents && i < curscroll + onscreen; ++i)
|
||||||
printptr(&dents[i], i == cur, ncols);
|
printptr(&dents[i], ncols, i == cur);
|
||||||
|
|
||||||
/* Must reset e.g. no files in dir */
|
/* Must reset e.g. no files in dir */
|
||||||
if (cfg.dircolor) {
|
if (cfg.dircolor) {
|
||||||
|
|
Loading…
Reference in a new issue