aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-12-10 18:25:00 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-12-10 18:37:10 +0530
commit8d143bb87ffe3083aaa15fdd6a3d8b085819371f (patch)
tree7593af63cd07789bc2a1cbd55593e324408c7bb3
parente8183058fd71dcaa8170e48bb731f7dc0f9f4c57 (diff)
downloadnnn-8d143bb87ffe3083aaa15fdd6a3d8b085819371f.tar.gz
Disable partial regex errors
-rw-r--r--README.md2
-rw-r--r--nnn.12
-rw-r--r--src/nnn.c11
3 files changed, 6 insertions, 9 deletions
diff --git a/README.md b/README.md
index c90ccd7..a152cba 100644
--- a/README.md
+++ b/README.md
@@ -46,7 +46,7 @@ Add to that an awesome [Wiki](https://github.com/jarun/nnn/wiki)!
- 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 efe6864..cb0f299 100644
--- a/nnn.1
+++ b/nnn.1
@@ -141,7 +141,7 @@ Common use cases:
(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 62d67e4..89a4037 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1801,12 +1801,7 @@ static char xchartohex(char c)
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 @@ static int filterentries(char *path)
*/
/* 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