mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
make option O_MATCHFLTR to disable filters without match
This commit is contained in:
parent
1d5efa7074
commit
87380732dc
5
Makefile
5
Makefile
|
@ -26,6 +26,7 @@ O_BENCH := 0 # benchmark mode (stops at first user input)
|
||||||
O_NOSSN := 0 # disable session support
|
O_NOSSN := 0 # disable session support
|
||||||
O_NOUG := 0 # disable user, group name in status bar
|
O_NOUG := 0 # disable user, group name in status bar
|
||||||
O_NOX11 := 0 # disable X11 integration
|
O_NOX11 := 0 # disable X11 integration
|
||||||
|
O_MATCHFLTR := 0 # allow filters without matches
|
||||||
|
|
||||||
# User patches
|
# User patches
|
||||||
O_GITSTATUS := 0 # add git status to detail view
|
O_GITSTATUS := 0 # add git status to detail view
|
||||||
|
@ -115,6 +116,10 @@ ifeq ($(strip $(O_NOX11)),1)
|
||||||
CPPFLAGS += -DNOX11
|
CPPFLAGS += -DNOX11
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(O_MATCHFLTR)),1)
|
||||||
|
CPPFLAGS += -DMATCHFLTR
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
|
ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
|
||||||
CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw)
|
CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw)
|
||||||
LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw)
|
LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw)
|
||||||
|
|
|
@ -21,9 +21,10 @@ O_ICONS := 0 # support icons-in-terminal
|
||||||
O_NERD := 0 # support icons-nerdfont
|
O_NERD := 0 # support icons-nerdfont
|
||||||
O_QSORT := 0 # use Alexey Tourbin's QSORT implementation
|
O_QSORT := 0 # use Alexey Tourbin's QSORT implementation
|
||||||
O_BENCH := 0 # benchmark mode (stops at first user input)
|
O_BENCH := 0 # benchmark mode (stops at first user input)
|
||||||
O_NOSSN := 0 # enable session support
|
O_NOSSN := 0 # disable session support
|
||||||
O_NOUG := 0 # disable user, group name in status bar
|
O_NOUG := 0 # disable user, group name in status bar
|
||||||
O_NOX11 := 0 # disable X11 integration
|
O_NOX11 := 0 # disable X11 integration
|
||||||
|
O_MATCHFLTR := 0 # allow filters without matches
|
||||||
|
|
||||||
# User patches
|
# User patches
|
||||||
O_GITSTATUS := 0 # add git status to detail view
|
O_GITSTATUS := 0 # add git status to detail view
|
||||||
|
@ -118,6 +119,10 @@ ifeq ($(strip $(O_NOX11)),1)
|
||||||
CPPFLAGS += -DNOX11
|
CPPFLAGS += -DNOX11
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(O_MATCHFLTR)),1)
|
||||||
|
CPPFLAGS += -DMATCHFLTR
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
|
ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
|
||||||
CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw)
|
CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw)
|
||||||
LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw)
|
LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw)
|
||||||
|
|
|
@ -3367,9 +3367,14 @@ static int filterentries(char *path, char *lastname)
|
||||||
* - new matches can only be a subset of current matches.
|
* - new matches can only be a subset of current matches.
|
||||||
*/
|
*/
|
||||||
/* ndents = total; */
|
/* ndents = total; */
|
||||||
|
#ifdef MATCHFLTR
|
||||||
|
r = matches(pln);
|
||||||
|
if (r <= 0) {
|
||||||
|
!r ? unget_wch(KEY_BACKSPACE) : showfilter(ln);
|
||||||
|
#else
|
||||||
if (matches(pln) == -1) {
|
if (matches(pln) == -1) {
|
||||||
showfilter(ln);
|
showfilter(ln);
|
||||||
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue