mirror of
https://github.com/jarun/nnn.git
synced 2025-02-26 03:01:32 +00:00
Drop brackets and simplify context printing logic
This commit is contained in:
parent
d4767e6d47
commit
949f76ec16
1 changed files with 4 additions and 7 deletions
11
src/nnn.c
11
src/nnn.c
|
@ -192,7 +192,7 @@
|
||||||
#define SED "sed"
|
#define SED "sed"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MIN_DISPLAY_COLS ((CTX_MAX * 2) + 2) /* Two chars for [ and ] */
|
#define MIN_DISPLAY_COLS (CTX_MAX * 2)
|
||||||
#define ARCHIVE_CMD_LEN 16
|
#define ARCHIVE_CMD_LEN 16
|
||||||
#define BLK_SHIFT_512 9
|
#define BLK_SHIFT_512 9
|
||||||
|
|
||||||
|
@ -596,7 +596,7 @@ static const char * const messages[] = {
|
||||||
"unknown",
|
"unknown",
|
||||||
"not set",
|
"not set",
|
||||||
"entry exists",
|
"entry exists",
|
||||||
"too few columns!",
|
"too few cols!",
|
||||||
"'s'shfs / 'r'clone?",
|
"'s'shfs / 'r'clone?",
|
||||||
"refresh if slow",
|
"refresh if slow",
|
||||||
"app name: ",
|
"app name: ",
|
||||||
|
@ -5769,8 +5769,7 @@ static void redraw(char *path)
|
||||||
//DPRINTF_D(cur);
|
//DPRINTF_D(cur);
|
||||||
DPRINTF_S(path);
|
DPRINTF_S(path);
|
||||||
|
|
||||||
addch('[');
|
for (i = 0; i < CTX_MAX; ++i) { /* 8 chars printed for contexts - "1 2 3 4 " */
|
||||||
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');
|
||||||
else
|
else
|
||||||
|
@ -5778,10 +5777,8 @@ static void redraw(char *path)
|
||||||
/* active: underline, current: reverse */
|
/* active: underline, current: reverse */
|
||||||
| ((cfg.curctx != i) ? A_UNDERLINE : A_REVERSE)));
|
| ((cfg.curctx != i) ? A_UNDERLINE : A_REVERSE)));
|
||||||
|
|
||||||
if (i != CTX_MAX - 1)
|
addch(' ');
|
||||||
addch(' ');
|
|
||||||
}
|
}
|
||||||
addstr("] "); /* 10 chars printed for contexts - "[1 2 3 4] " */
|
|
||||||
|
|
||||||
attron(A_UNDERLINE | COLOR_PAIR(cfg.curctx + 1));
|
attron(A_UNDERLINE | COLOR_PAIR(cfg.curctx + 1));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue