mirror of
https://github.com/jarun/nnn.git
synced 2024-12-01 02:49:44 +00:00
Show status bar info in context color
This commit is contained in:
parent
e5ba4f69bb
commit
707e30a590
26
src/nnn.c
26
src/nnn.c
|
@ -789,14 +789,14 @@ static inline void printmsg_nc(const char *msg)
|
||||||
{
|
{
|
||||||
tolastln();
|
tolastln();
|
||||||
addstr(msg);
|
addstr(msg);
|
||||||
hline(' ', xcols);
|
addch('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
static void printmsg(const char *msg)
|
static void printmsg(const char *msg)
|
||||||
{
|
{
|
||||||
attron(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
|
attron(COLOR_PAIR(cfg.curctx + 1));
|
||||||
printmsg_nc(msg);
|
printmsg_nc(msg);
|
||||||
attroff(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
|
attroff(COLOR_PAIR(cfg.curctx + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void printwait(const char *msg, int *presel)
|
static void printwait(const char *msg, int *presel)
|
||||||
|
@ -2706,10 +2706,10 @@ static char *xreadline(const char *prefill, const char *prompt)
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
buf[len] = ' ';
|
buf[len] = ' ';
|
||||||
attron(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
|
attron(COLOR_PAIR(cfg.curctx + 1));
|
||||||
mvaddnwstr(xlines - 1, x, buf, len + 1);
|
mvaddnwstr(xlines - 1, x, buf, len + 1);
|
||||||
move(xlines - 1, x + wcswidth(buf, pos));
|
move(xlines - 1, x + wcswidth(buf, pos));
|
||||||
attroff(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
|
attroff(COLOR_PAIR(cfg.curctx + 1));
|
||||||
|
|
||||||
r = get_wch(ch);
|
r = get_wch(ch);
|
||||||
if (r == ERR)
|
if (r == ERR)
|
||||||
|
@ -4356,8 +4356,7 @@ static blkcnt_t dirwalk(char *path, struct stat *psb)
|
||||||
ent_blocks = 0;
|
ent_blocks = 0;
|
||||||
tolastln();
|
tolastln();
|
||||||
addstr(xbasename(path));
|
addstr(xbasename(path));
|
||||||
addstr(" [^C aborts]");
|
addstr(" [^C aborts]\n");
|
||||||
hline(' ', xcols);
|
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
if (nftw(path, nftw_fn, open_max, FTW_MOUNT | FTW_PHYS) < 0) {
|
if (nftw(path, nftw_fn, open_max, FTW_MOUNT | FTW_PHYS) < 0) {
|
||||||
|
@ -4407,7 +4406,7 @@ static int dentfill(char *path, struct entry **dents)
|
||||||
} else
|
} else
|
||||||
clear_hash();
|
clear_hash();
|
||||||
|
|
||||||
attron(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
|
attron(COLOR_PAIR(cfg.curctx + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if _POSIX_C_SOURCE >= 200112L
|
#if _POSIX_C_SOURCE >= 200112L
|
||||||
|
@ -4582,7 +4581,7 @@ static int dentfill(char *path, struct entry **dents)
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if (cfg.blkorder)
|
if (cfg.blkorder)
|
||||||
attroff(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
|
attroff(COLOR_PAIR(cfg.curctx + 1));
|
||||||
|
|
||||||
/* Should never be null */
|
/* Should never be null */
|
||||||
if (closedir(dirp) == -1)
|
if (closedir(dirp) == -1)
|
||||||
|
@ -4899,14 +4898,14 @@ static void statusbar(char *path)
|
||||||
ptr = "\b";
|
ptr = "\b";
|
||||||
|
|
||||||
tolastln();
|
tolastln();
|
||||||
attron(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
|
attron(COLOR_PAIR(cfg.curctx + 1));
|
||||||
|
|
||||||
if (cfg.blkorder) { /* du mode */
|
if (cfg.blkorder) { /* du mode */
|
||||||
char buf[24];
|
char buf[24];
|
||||||
|
|
||||||
xstrlcpy(buf, coolsize(dir_blocks << blk_shift), 12);
|
xstrlcpy(buf, coolsize(dir_blocks << blk_shift), 12);
|
||||||
|
|
||||||
printw("%d/%d [%s:%s] %cu:%s free:%s files:%lu %lldB %s",
|
printw("%d/%d [%s:%s] %cu:%s free:%s files:%lu %lldB %s\n",
|
||||||
cur + 1, ndents, (cfg.selmode ? "s" : ""),
|
cur + 1, ndents, (cfg.selmode ? "s" : ""),
|
||||||
((g_states & STATE_RANGESEL) ? "*" : (nselected ? xitoa(nselected) : "")),
|
((g_states & STATE_RANGESEL) ? "*" : (nselected ? xitoa(nselected) : "")),
|
||||||
(cfg.apparentsz ? 'a' : 'd'), buf, coolsize(get_fs_info(path, FREE)),
|
(cfg.apparentsz ? 'a' : 'd'), buf, coolsize(get_fs_info(path, FREE)),
|
||||||
|
@ -4916,7 +4915,7 @@ static void statusbar(char *path)
|
||||||
|
|
||||||
getorderstr(sort);
|
getorderstr(sort);
|
||||||
|
|
||||||
printw("%d/%d [%s:%s] %s", cur + 1, ndents, (cfg.selmode ? "s" : ""),
|
printw("%d/%d [%s:%s] %s\n", cur + 1, ndents, (cfg.selmode ? "s" : ""),
|
||||||
((g_states & STATE_RANGESEL) ? "*" : (nselected ? xitoa(nselected) : "")),
|
((g_states & STATE_RANGESEL) ? "*" : (nselected ? xitoa(nselected) : "")),
|
||||||
sort);
|
sort);
|
||||||
|
|
||||||
|
@ -4931,8 +4930,7 @@ static void statusbar(char *path)
|
||||||
addstr(ptr);
|
addstr(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
hline(' ', xcols);
|
attroff(COLOR_PAIR(cfg.curctx + 1));
|
||||||
attroff(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int adjust_cols(int ncols)
|
static int adjust_cols(int ncols)
|
||||||
|
|
Loading…
Reference in a new issue