mirror of
https://github.com/jarun/nnn.git
synced 2024-12-01 02:49:44 +00:00
Code reformat
This commit is contained in:
parent
bc6295e7a7
commit
d47be4e89b
33
src/nnn.c
33
src/nnn.c
|
@ -2253,6 +2253,9 @@ static bool handle_archive(char *fpath, char *arg, char *dir)
|
||||||
*/
|
*/
|
||||||
static bool show_help(char *path)
|
static bool show_help(char *path)
|
||||||
{
|
{
|
||||||
|
int i = 0, fd;
|
||||||
|
char *start, *end;
|
||||||
|
|
||||||
if (g_tmpfpath[0])
|
if (g_tmpfpath[0])
|
||||||
xstrlcpy(g_tmpfpath + g_tmpfplen - 1, messages[STR_TMPFILE],
|
xstrlcpy(g_tmpfpath + g_tmpfplen - 1, messages[STR_TMPFILE],
|
||||||
HOME_LEN_MAX - g_tmpfplen);
|
HOME_LEN_MAX - g_tmpfplen);
|
||||||
|
@ -2261,8 +2264,7 @@ static bool show_help(char *path)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = 0, fd = mkstemp(g_tmpfpath);
|
fd = mkstemp(g_tmpfpath);
|
||||||
char *start, *end;
|
|
||||||
|
|
||||||
static char helpstr[] = {
|
static char helpstr[] = {
|
||||||
"0\n"
|
"0\n"
|
||||||
|
@ -2633,17 +2635,9 @@ static void redraw(char *path)
|
||||||
|
|
||||||
printw("[");
|
printw("[");
|
||||||
for (i = 0; i < CTX_MAX; ++i) {
|
for (i = 0; i < CTX_MAX; ++i) {
|
||||||
/* Print current context in reverse */
|
if (!g_ctx[i].c_cfg.ctxactive)
|
||||||
if (cfg.curctx == i) {
|
printw("%d ", i + 1);
|
||||||
if (cfg.showcolor)
|
else if (cfg.curctx != i) {
|
||||||
attrs = COLOR_PAIR(i + 1) | A_BOLD | A_REVERSE;
|
|
||||||
else
|
|
||||||
attrs = A_REVERSE;
|
|
||||||
attron(attrs);
|
|
||||||
printw("%d", i + 1);
|
|
||||||
attroff(attrs);
|
|
||||||
printw(" ");
|
|
||||||
} else if (g_ctx[i].c_cfg.ctxactive) {
|
|
||||||
if (cfg.showcolor)
|
if (cfg.showcolor)
|
||||||
attrs = COLOR_PAIR(i + 1) | A_BOLD | A_UNDERLINE;
|
attrs = COLOR_PAIR(i + 1) | A_BOLD | A_UNDERLINE;
|
||||||
else
|
else
|
||||||
|
@ -2652,8 +2646,17 @@ static void redraw(char *path)
|
||||||
printw("%d", i + 1);
|
printw("%d", i + 1);
|
||||||
attroff(attrs);
|
attroff(attrs);
|
||||||
printw(" ");
|
printw(" ");
|
||||||
} else
|
} else {
|
||||||
printw("%d ", i + 1);
|
/* Print current context in reverse */
|
||||||
|
if (cfg.showcolor)
|
||||||
|
attrs = COLOR_PAIR(i + 1) | A_BOLD | A_REVERSE;
|
||||||
|
else
|
||||||
|
attrs = A_REVERSE;
|
||||||
|
attron(attrs);
|
||||||
|
printw("%d", i + 1);
|
||||||
|
attroff(attrs);
|
||||||
|
printw(" ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
printw("\b] "); /* 10 chars printed in total for contexts - "[1 2 3 4] " */
|
printw("\b] "); /* 10 chars printed in total for contexts - "[1 2 3 4] " */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue