diff options
author | 2020-07-13 00:00:34 +0530 | |
---|---|---|
committer | 2020-07-13 00:00:34 +0530 | |
commit | 387bd048e7d2baea0decfdbbdfb799ea994de064 (patch) | |
tree | df6c8f3d0f56c802063e9611a7d91310e59f39f1 /src | |
parent | 890425c08cdf8b589ab1ce55e56fd63542076278 (diff) | |
download | nnn-387bd048e7d2baea0decfdbbdfb799ea994de064.tar.gz |
Alt+Esc to exit nav-to-type and redraw
Diffstat (limited to 'src')
-rw-r--r-- | src/nnn.c | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -2377,8 +2377,12 @@ static int nextsel(int presel) timeout(0); c = getch(); if (c != ERR) { - ungetch(c); - c = ';'; + if (c == 27) + c = CONTROL('L'); + else { + ungetch(c); + c = ';'; + } } else c = 27; settimeout(); @@ -2647,8 +2651,17 @@ static int filterentries(char *path, char *lastname) #endif case 27: /* Exit filter mode on Escape and Alt+key */ if (handle_alt_key(ch) != ERR) { - unget_wch(*ch); - *ch = ';'; + if (*ch == 27) { /* Handle Alt + Esc */ + 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; } |