]> Sergey Matveev's repositories - nnn.git/commitdiff
Remove redundant prompt
authorArun Prakash Jana <engineerarun@gmail.com>
Sun, 11 Jul 2021 19:00:41 +0000 (00:30 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 11 Jul 2021 19:52:39 +0000 (01:22 +0530)
Makefile
misc/haiku/Makefile
src/nnn.c

index 3f4eeb97b8fbc5e1961192ca142834727db92d16..6595f61a1d1ed6d826b3079d7bef79043e05f85f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,6 @@ O_BENCH := 0  # benchmark mode (stops at first user input)
 O_NOSSN := 0  # enable session support
 O_NOUG := 0  # disable user, group name in status bar
 O_NOX11 := 0  # disable X11 integration
-O_LARGESEL := 0 # set threshold for large selection
 
 # User patches
 O_GITSTATUS := 0 # add git status to detail view
@@ -116,10 +115,6 @@ ifeq ($(strip $(O_NOX11)),1)
        CPPFLAGS += -DNOX11
 endif
 
-ifneq ($(strip $(O_LARGESEL)),0)
-       CPPFLAGS += -DLARGESEL=$(strip $(O_LARGESEL))
-endif
-
 ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
        CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw)
        LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs   ncursesw)
index 2da240a13507b6fe0b7fc1b7d8a60a12e7ebe207..c4aabe14c9a0adc3612fa3f63cad45558f190f37 100644 (file)
@@ -24,7 +24,6 @@ O_BENCH := 0  # benchmark mode (stops at first user input)
 O_NOSSN := 0  # enable session support
 O_NOUG := 0  # disable user, group name in status bar
 O_NOX11 := 0  # disable X11 integration
-O_LARGESEL := 0 # set threshold for large selection
 
 # User patches
 O_GITSTATUS := 0 # add git status to detail view
@@ -119,10 +118,6 @@ ifeq ($(strip $(O_NOX11)),1)
        CPPFLAGS += -DNOX11
 endif
 
-ifneq ($(strip $(O_LARGESEL)),0)
-       CPPFLAGS += -DLARGESEL=$(strip $(O_LARGESEL))
-endif
-
 ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
        CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw)
        LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs   ncursesw)
index 3df950005e9a987a3a442f1c5067cb47f315aae8..cad82ba331cb6323c5180a34f2214e42661cb6aa 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -611,9 +611,8 @@ static char * const utils[] = {
 #define MSG_RM_TMP       39
 #define MSG_INVALID_KEY  40
 #define MSG_NOCHANGE     41
-#define MSG_LARGESEL     42
 #ifndef DIR_LIMITED_SELECTION
-#define MSG_DIR_CHANGED  43 /* Must be the last entry */
+#define MSG_DIR_CHANGED  42 /* Must be the last entry */
 #endif
 
 static const char * const messages[] = {
@@ -659,7 +658,6 @@ static const char * const messages[] = {
        "remove tmp file?",
        "invalid key",
        "unchanged",
-       "inversion may be slow, continue?",
 #ifndef DIR_LIMITED_SELECTION
        "dir changed, range sel off", /* Must be the last entry */
 #endif
@@ -1571,17 +1569,15 @@ static int markcmp(const void *va, const void *vb)
 
 static void invertselbuf(char *path)
 {
-       /* This may be slow for large selection, ask for confirmation */
-       if (nselected > LARGESEL && !xconfirm(get_input(messages[MSG_LARGESEL])))
-               return;
-
        size_t len, endpos, offset = 0;
        char *found;
        int nmarked = 0, prev = 0;
        selmark *marked = malloc(nselected * sizeof(selmark));
 
-       printmsg("processing...");
-       refresh();
+       if (nselected > LARGESEL) {
+               printmsg("processing...");
+               refresh();
+       }
 
        /* First pass: inversion */
        for (int i = 0; i < ndents; ++i) {