mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 13:51:31 +00:00
Fix backspace rendering and error handling.
Fixes the following issues: - When in filter mode, hitting backspace on the first character renders the backspace character on the screen along with the first character instead of just the search prompt (i.e. '/'). For example, hitting backspace 3 times on the search string 'abc' produces this sequence: /abc /ab /a /a^? - Go to the 'end' label if matches() fails (via regcomp()) when hitting backspace.
This commit is contained in:
parent
424abe15ca
commit
f800cc14a8
9
nnn.c
9
nnn.c
|
@ -1077,8 +1077,13 @@ filterentries(char *path)
|
|||
|
||||
wcstombs(ln, wln, REGEX_MAX);
|
||||
ndents = total;
|
||||
if (matches(pln) == -1)
|
||||
continue;
|
||||
char *tmppln = pln;
|
||||
if (strcmp(pln, "") == 0) {
|
||||
tmppln=".*"; //otherwise setfilter will fail for the empty string.
|
||||
}
|
||||
if (matches(tmppln) == -1) {
|
||||
goto end;
|
||||
}
|
||||
redraw(path);
|
||||
printprompt(ln);
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue