mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Bksp/Del at empty filter prompt to refresh dir and retain prompt
This commit is contained in:
parent
1fde10b022
commit
34c3d2116a
2
nnn.1
2
nnn.1
|
@ -214,6 +214,8 @@ Special keys at \fBempty filter prompt\fR:
|
||||||
: | Toggle case-sensitivity
|
: | Toggle case-sensitivity
|
||||||
^L | Clear filter (\fIif prompt is non-empty\fR)
|
^L | Clear filter (\fIif prompt is non-empty\fR)
|
||||||
| OR apply last filter
|
| OR apply last filter
|
||||||
|
Bksp | Stay at filter prompt and refresh dir
|
||||||
|
Del | Stay at filter prompt and refresh dir
|
||||||
------ + ---------------------------------------
|
------ + ---------------------------------------
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
|
|
|
@ -2857,8 +2857,10 @@ static int filterentries(char *path, char *lastname)
|
||||||
wln[--len] = '\0';
|
wln[--len] = '\0';
|
||||||
wcstombs(ln, wln, REGEX_MAX);
|
wcstombs(ln, wln, REGEX_MAX);
|
||||||
ndents = total;
|
ndents = total;
|
||||||
} else
|
} else {
|
||||||
continue;
|
*ch = FILTER;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
// fallthrough
|
// fallthrough
|
||||||
case CONTROL('L'):
|
case CONTROL('L'):
|
||||||
if (*ch == CONTROL('L')) {
|
if (*ch == CONTROL('L')) {
|
||||||
|
@ -6436,11 +6438,12 @@ nochange:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
presel = filterentries(path, lastname);
|
presel = filterentries(path, lastname);
|
||||||
|
|
||||||
if (presel == ESC) {
|
if (presel == ESC) {
|
||||||
presel = 0;
|
presel = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (presel == FILTER) /* Refresh dir and filter again */
|
||||||
|
goto begin;
|
||||||
goto nochange;
|
goto nochange;
|
||||||
case SEL_MFLTR: // fallthrough
|
case SEL_MFLTR: // fallthrough
|
||||||
case SEL_HIDDEN: // fallthrough
|
case SEL_HIDDEN: // fallthrough
|
||||||
|
|
Loading…
Reference in a new issue