Makefile | 5 +++++ src/nnn.c | 2 ++ diff --git a/Makefile b/Makefile index c6edbfa39cc0ea65e04860cc931d2fee745e52fa..51db4661a48583ef17fe8264fa36a723d990dbb2 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,7 @@ 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 # User patches O_GITSTATUS := 0 # add git status to detail view @@ -119,6 +120,10 @@ endif ifeq ($(strip $(O_MATCHFLTR)),1) CPPFLAGS += -DMATCHFLTR +endif + +ifeq ($(strip $(O_NOSORT)),1) + CPPFLAGS += -DNOSORT endif ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1) diff --git a/src/nnn.c b/src/nnn.c index 900ed00fb83774588c872d1e017becfec7933606..8673207e4b781776402290059dd02246dc0721c2 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -5847,7 +5847,9 @@ ndents = dentfill(path, &pdents); if (!ndents) return; +#ifndef NOSORT ENTSORT(pdents, ndents, entrycmpfn); +#endif #ifdef DEBUG clock_gettime(CLOCK_REALTIME, &ts2);