Bksp/Del at empty filter prompt to refresh dir and retain prompt

This commit is contained in:
Arun Prakash Jana 2021-04-26 00:29:35 +05:30
parent 1fde10b022
commit 34c3d2116a
No known key found for this signature in database
GPG Key ID: A75979F35C080412
2 changed files with 8 additions and 3 deletions

2
nnn.1
View File

@ -214,6 +214,8 @@ Special keys at \fBempty filter prompt\fR:
: | Toggle case-sensitivity
^L | Clear filter (\fIif prompt is non-empty\fR)
| OR apply last filter
Bksp | Stay at filter prompt and refresh dir
Del | Stay at filter prompt and refresh dir
------ + ---------------------------------------
.Ed
.Pp

View File

@ -2857,8 +2857,10 @@ static int filterentries(char *path, char *lastname)
wln[--len] = '\0';
wcstombs(ln, wln, REGEX_MAX);
ndents = total;
} else
continue;
} else {
*ch = FILTER;
goto end;
}
// fallthrough
case CONTROL('L'):
if (*ch == CONTROL('L')) {
@ -6436,11 +6438,12 @@ nochange:
}
#endif
presel = filterentries(path, lastname);
if (presel == ESC) {
presel = 0;
break;
}
if (presel == FILTER) /* Refresh dir and filter again */
goto begin;
goto nochange;
case SEL_MFLTR: // fallthrough
case SEL_HIDDEN: // fallthrough