Browse Source

Show status bar info in context color

master
Arun Prakash Jana 4 years ago
parent
commit
707e30a590
No known key found for this signature in database GPG Key ID: A75979F35C080412
1 changed files with 12 additions and 14 deletions
  1. +12
    -14
      src/nnn.c

+ 12
- 14
src/nnn.c View File

@@ -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]");
hline(' ', xcols);
addstr(" [^C aborts]\n");
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) | A_REVERSE);
attroff(COLOR_PAIR(cfg.curctx + 1));
} }


static int adjust_cols(int ncols) static int adjust_cols(int ncols)


Loading…
Cancel
Save