/* Function macros */
#define tolastln() move(xlines - 1, 0)
#define exitcurses() endwin()
-#define clearprompt() printmsg("")
#define printwarn(presel) printwait(strerror(errno), presel)
#define istopdir(path) ((path)[1] == '\0' && (path)[0] == '/')
#define copycurname() xstrlcpy(lastname, dents[cur].name, NAME_MAX + 1)
static void printmsg(const char *msg)
{
tolastln();
+ attron(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
addstr(msg);
- addch('\n');
+ hline(' ', xcols);
+ attroff(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
}
static void printwait(const char *msg, int *presel)
exit(1);
}
-/* Print prompt on the last line */
-static void printprompt(const char *str)
-{
- clearprompt();
- addstr(str);
-}
-
static void printinfoln(const char *str)
{
clearinfoln();
int r;
if (prompt)
- printprompt(prompt);
+ printmsg(prompt);
cleartimeout();
#ifdef KEY_RESIZE
do {
if (r == KEY_RESIZE && prompt) {
clearoldprompt();
xlines = LINES;
- printprompt(prompt);
+ printmsg(prompt);
}
} while (r == KEY_RESIZE);
#else
static void showfilter(char *str)
{
showfilterinfo();
- printprompt(str);
+ printmsg(str);
}
static inline void swap_ent(int id1, int id2)
errexit();
cleartimeout();
- printprompt(prompt);
+ printmsg(prompt);
if (prefill) {
DPRINTF_S(prefill);
while (1) {
buf[len] = ' ';
+ attron(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
mvaddnwstr(xlines - 1, x, buf, len + 1);
move(xlines - 1, x + wcswidth(buf, pos));
+ attroff(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
r = get_wch(ch);
if (r == ERR)
--pos;
continue;
case CONTROL('W'):
- printprompt(prompt);
+ printmsg(prompt);
do {
if (pos == 0)
break;
} while (buf[pos - 1] != ' ' && buf[pos - 1] != '/'); // NOLINT
continue;
case CONTROL('K'):
- printprompt(prompt);
+ printmsg(prompt);
len = pos;
continue;
case CONTROL('L'):
- printprompt(prompt);
+ printmsg(prompt);
len = pos = 0;
continue;
case CONTROL('A'):
pos = len;
continue;
case CONTROL('U'):
- printprompt(prompt);
+ printmsg(prompt);
memmove(buf, buf + pos, (len - pos) * WCHAR_T_WIDTH);
len -= pos;
pos = 0;
case KEY_RESIZE:
clearoldprompt();
xlines = LINES;
- printprompt(prompt);
+ printmsg(prompt);
break;
#endif
case KEY_LEFT:
END:
curs_set(FALSE);
settimeout();
- clearprompt();
+ printmsg("");
buf[len] = '\0';
++r;
}
printkeys(bookmark, g_buf + r - 1, maxbm);
- printprompt(g_buf);
+ printmsg(g_buf);
r = FALSE;
fd = get_input(NULL);
ent_blocks = 0;
tolastln();
addstr(xbasename(path));
- addstr(" [^C aborts]\n");
+ addstr(" [^C aborts]");
+ hline(' ', xcols);
refresh();
if (nftw(path, nftw_fn, open_max, FTW_MOUNT | FTW_PHYS) < 0) {
goto exit;
} else
clear_hash();
+
+ attron(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
}
#if _POSIX_C_SOURCE >= 200112L
} while ((dp = readdir(dirp)));
exit:
+ if (cfg.blkorder)
+ attroff(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
+
/* Should never be null */
if (closedir(dirp) == -1)
errexit();
ptr = "\b";
tolastln();
+ attron(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
if (cfg.blkorder) { /* du mode */
char buf[24];
addstr(ptr);
}
- addch('\n');
+ hline(' ', xcols);
+ attroff(COLOR_PAIR(cfg.curctx + 1) | A_REVERSE);
}
static int adjust_cols(int ncols)
r = xstrlcpy(g_buf, messages[MSG_PLUGIN_KEYS], CMD_LEN_MAX);
printkeys(plug, g_buf + r - 1, maxplug);
- printprompt(g_buf);
+ printmsg(g_buf);
r = get_input(NULL);
if (r != '\r') {
endselection();