mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
F5 to redraw (even with filter)
This commit is contained in:
parent
04f9698d86
commit
8e9c4ec88b
24
src/nnn.c
24
src/nnn.c
|
@ -2569,18 +2569,23 @@ static int filterentries(char *path, char *lastname)
|
||||||
} else
|
} else
|
||||||
continue;
|
continue;
|
||||||
// fallthrough
|
// fallthrough
|
||||||
|
case KEY_F(5): // fallthrough
|
||||||
case CONTROL('L'):
|
case CONTROL('L'):
|
||||||
if (*ch == CONTROL('L')) {
|
if (*ch == CONTROL('L') || *ch == KEY_F(5)) {
|
||||||
if (wln[1]) {
|
if (wln[1]) {
|
||||||
ln[REGEX_MAX - 1] = ln[1];
|
ln[REGEX_MAX - 1] = ln[1];
|
||||||
ln[1] = wln[1] = '\0';
|
ln[1] = wln[1] = '\0';
|
||||||
len = 1;
|
len = 1;
|
||||||
ndents = total;
|
ndents = total;
|
||||||
} else if (ln[REGEX_MAX - 1]) { /* Show the previous filter */
|
} else if (*ch == CONTROL('L') && ln[REGEX_MAX - 1]) {
|
||||||
|
/* Show the previous filter */
|
||||||
ln[1] = ln[REGEX_MAX - 1];
|
ln[1] = ln[REGEX_MAX - 1];
|
||||||
ln[REGEX_MAX - 1] = '\0';
|
ln[REGEX_MAX - 1] = '\0';
|
||||||
len = mbstowcs(wln, ln, REGEX_MAX);
|
len = mbstowcs(wln, ln, REGEX_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (*ch == KEY_F(5))
|
||||||
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Go to the top, we don't know if the hovered file will match the filter */
|
/* Go to the top, we don't know if the hovered file will match the filter */
|
||||||
|
@ -2597,17 +2602,8 @@ static int filterentries(char *path, char *lastname)
|
||||||
#endif
|
#endif
|
||||||
case 27: /* Exit filter mode on Escape and Alt+key */
|
case 27: /* Exit filter mode on Escape and Alt+key */
|
||||||
if (handle_alt_key(ch) != ERR) {
|
if (handle_alt_key(ch) != ERR) {
|
||||||
if (*ch == 27) { /* Handle Alt + Esc */
|
unget_wch(*ch);
|
||||||
if (wln[1]) {
|
*ch = CONTROL('S');
|
||||||
ln[REGEX_MAX - 1] = ln[1];
|
|
||||||
ln[1] = wln[1] = '\0';
|
|
||||||
ndents = total;
|
|
||||||
*ch = CONTROL('L');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
unget_wch(*ch);
|
|
||||||
*ch = CONTROL('S');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -4145,7 +4141,7 @@ static void show_help(const char *path)
|
||||||
"a1-4 Context 1-4%-7c(Sh)Tab Cycle context\n"
|
"a1-4 Context 1-4%-7c(Sh)Tab Cycle context\n"
|
||||||
"c/ Filter%-17c^N Toggle type-to-nav\n"
|
"c/ Filter%-17c^N Toggle type-to-nav\n"
|
||||||
"aEsc Exit prompt%-12c^L Redraw/clear prompt\n"
|
"aEsc Exit prompt%-12c^L Redraw/clear prompt\n"
|
||||||
"c0 Lock%-14cAlt+Esc Clear filter, redraw\n"
|
"c0 Lock%-19cF5 Redraw\n"
|
||||||
"c? Help, conf%-13c^G QuitCD\n"
|
"c? Help, conf%-13c^G QuitCD\n"
|
||||||
"cq Quit context%-7c^Q (Q) Quit (with err)\n"
|
"cq Quit context%-7c^Q (Q) Quit (with err)\n"
|
||||||
"1FILES\n"
|
"1FILES\n"
|
||||||
|
|
|
@ -199,6 +199,7 @@ static struct key bindings[] = {
|
||||||
{ CONTROL('T'), SEL_SORT },
|
{ CONTROL('T'), SEL_SORT },
|
||||||
/* Redraw window */
|
/* Redraw window */
|
||||||
{ CONTROL('L'), SEL_REDRAW },
|
{ CONTROL('L'), SEL_REDRAW },
|
||||||
|
{ KEY_F(5), SEL_REDRAW },
|
||||||
/* Select current file path */
|
/* Select current file path */
|
||||||
{ CONTROL('J'), SEL_SEL },
|
{ CONTROL('J'), SEL_SEL },
|
||||||
{ ' ', SEL_SEL },
|
{ ' ', SEL_SEL },
|
||||||
|
|
Loading…
Reference in a new issue