From aa2147f3efce13a9462d93009b0a8e739cd12682 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sun, 23 Jan 2022 10:52:33 +0530 Subject: [PATCH] make option O_NOSORT to disable sort on dir load --- Makefile | 5 +++++ src/nnn.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Makefile b/Makefile index c6edbfa3..51db4661 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 @@ -121,6 +122,10 @@ ifeq ($(strip $(O_MATCHFLTR)),1) CPPFLAGS += -DMATCHFLTR endif +ifeq ($(strip $(O_NOSORT)),1) + CPPFLAGS += -DNOSORT +endif + ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1) CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw) LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw) diff --git a/src/nnn.c b/src/nnn.c index 900ed00f..8673207e 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -5847,7 +5847,9 @@ static void populate(char *path, char *lastname) if (!ndents) return; +#ifndef NOSORT ENTSORT(pdents, ndents, entrycmpfn); +#endif #ifdef DEBUG clock_gettime(CLOCK_REALTIME, &ts2); -- 2.48.1