mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Alt+Esc to exit nav-to-type and redraw
This commit is contained in:
parent
890425c08c
commit
387bd048e7
21
src/nnn.c
21
src/nnn.c
|
@ -2377,8 +2377,12 @@ static int nextsel(int presel)
|
||||||
timeout(0);
|
timeout(0);
|
||||||
c = getch();
|
c = getch();
|
||||||
if (c != ERR) {
|
if (c != ERR) {
|
||||||
ungetch(c);
|
if (c == 27)
|
||||||
c = ';';
|
c = CONTROL('L');
|
||||||
|
else {
|
||||||
|
ungetch(c);
|
||||||
|
c = ';';
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
c = 27;
|
c = 27;
|
||||||
settimeout();
|
settimeout();
|
||||||
|
@ -2647,8 +2651,17 @@ 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) {
|
||||||
unget_wch(*ch);
|
if (*ch == 27) { /* Handle Alt + Esc */
|
||||||
*ch = ';';
|
if (wln[1]) {
|
||||||
|
ln[REGEX_MAX - 1] = ln[1];
|
||||||
|
ln[1] = wln[1] = '\0';
|
||||||
|
ndents = total;
|
||||||
|
*ch = CONTROL('L');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unget_wch(*ch);
|
||||||
|
*ch = ';';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue