mirror of
https://github.com/jarun/nnn.git
synced 2025-03-01 20:39:20 +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
1 changed files with 7 additions and 2 deletions
9
nnn.c
9
nnn.c
|
@ -1077,8 +1077,13 @@ filterentries(char *path)
|
||||||
|
|
||||||
wcstombs(ln, wln, REGEX_MAX);
|
wcstombs(ln, wln, REGEX_MAX);
|
||||||
ndents = total;
|
ndents = total;
|
||||||
if (matches(pln) == -1)
|
char *tmppln = pln;
|
||||||
continue;
|
if (strcmp(pln, "") == 0) {
|
||||||
|
tmppln=".*"; //otherwise setfilter will fail for the empty string.
|
||||||
|
}
|
||||||
|
if (matches(tmppln) == -1) {
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
redraw(path);
|
redraw(path);
|
||||||
printprompt(ln);
|
printprompt(ln);
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Reference in a new issue