Use a shorter width param

This commit is contained in:
Arun Prakash Jana 2020-01-02 03:02:53 +05:30
parent a36146f9c0
commit 4a3bf6d40f

View file

@ -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) {