README.md | 2 +- nnn.1 | 2 +- src/nnn.c | 11 ++++------- diff --git a/README.md b/README.md index c90ccd72114d0c273201585f8a55fbb13588fdcb..a152cba079e027420ea190dff406ecf3b9896398 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ - Case-insensitive version (_aka_ natural) sort - By file name, modification/access time, size, extension - Search - Instant filtering with *search-as-you-type* - - Regex and substring match + - Regex (default) and substring match - Subtree search to open or edit files (using plugin) - Mimes - Open with desktop opener or specify a custom app diff --git a/nnn.1 b/nnn.1 index efe686414b2f639724dc632b94afdbfb89bdd70f..cb0f29982d5234161c41e5b108d05182cbb0eaef 100644 --- a/nnn.1 +++ b/nnn.1 @@ -141,7 +141,7 @@ .Pp (1) To list all matches starting with the filter expression, start the expression with a '^' (caret) symbol. .br -(2) Type '^.*\\.mkv' to list all MKV files. +(2) Type '\\.mkv' to list all MKV files. .br (3) Use '.*' to match any character (\fIsort of\fR fuzzy search). .Pp diff --git a/src/nnn.c b/src/nnn.c index 62d67e41bafc4e9fe0972a0a1559a9469af54865..89a40370027520906122dc5dd1fbc1f5e7e313df 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -1801,12 +1801,7 @@ } static int setfilter(regex_t *regex, const char *filter) { - int r = regcomp(regex, filter, REG_NOSUB | REG_EXTENDED | REG_ICASE); - - if (r != 0 && filter && filter[0] != '\0') - mvprintw(xlines - 1, 0, "regex error: %d\n", r); - - return r; + return regcomp(regex, filter, REG_NOSUB | REG_EXTENDED | REG_ICASE); } static int visible_re(const fltrexp_t *fltrexp, const char *fname) @@ -2131,8 +2126,10 @@ * - new matches can only be a subset of current matches. */ /* ndents = total; */ - if (matches(pln) == -1) + if (matches(pln) == -1) { + printprompt(ln); continue; + } /* If the only match is a dir, auto-select and cd into it */ if (ndents == 1 && cfg.filtermode