commit ee7d6e1ce317f3b880851bc70653572a85886157
parent 1b9d4438f2a013f35ef21afddf1e1950145a2939
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date: Sun, 22 Feb 2026 22:45:38 +0530
Ignore input key when no matches for filter
Show a visual feedback
Retire make option O_MATCHFLTR
Diffstat:
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/Makefile b/Makefile
@@ -26,7 +26,6 @@ O_BENCH := 0 # benchmark mode (stops at first user input)
O_NOSSN := 0 # disable session support
O_NOUG := 0 # disable user, group name in status bar
O_NOX11 := 0 # disable X11 integration
-O_MATCHFLTR := 0 # allow filters without matches
O_NOSORT := 0 # disable sorting entries on dir load
O_DIMFILTERED := 1 # dim characters matching filter (default: enabled)
@@ -139,10 +138,6 @@ ifeq ($(strip $(O_NOX11)),1)
CPPFLAGS += -DNOX11
endif
-ifeq ($(strip $(O_MATCHFLTR)),1)
- CPPFLAGS += -DMATCHFLTR
-endif
-
ifeq ($(strip $(O_NOSORT)),1)
CPPFLAGS += -DNOSORT
endif
diff --git a/src/nnn.c b/src/nnn.c
@@ -3787,14 +3787,13 @@ static int filterentries(char *path, char *lastname)
* - new matches can only be a subset of current matches.
*/
/* ndents = total; */
-#ifdef MATCHFLTR
r = matches(pln);
if (r <= 0) {
- !r ? unget_wch(KEY_BACKSPACE) : showfilter(ln);
-#else
- if (matches(pln) == -1) {
- showfilter(ln);
-#endif
+ if (r == 0)
+ unget_wch(KEY_BACKSPACE);
+ attron((COLOR_PAIR(cfg.curctx + 1)) | A_REVERSE | A_STANDOUT);
+ printmsg_nc(ln);
+ attroff((COLOR_PAIR(cfg.curctx + 1)) | A_REVERSE | A_STANDOUT);
continue;
}