From 99d15815f03c8fa19ee36fa7e9190d5f8be8ee7f Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sat, 11 Jan 2020 21:46:37 +0530 Subject: [PATCH] Use : for filter case --- nnn.1 | 2 +- plugins/nuke | 1 + src/dbg.h | 2 +- src/nnn.c | 5 +++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/nnn.1 b/nnn.1 index 2193f08f..b0a18099 100644 --- a/nnn.1 +++ b/nnn.1 @@ -146,7 +146,7 @@ To modify match criteria at runtime: .br - regex to string: press '/' at empty filter prompt .br -- toggle case sensitivity: press '|' at empty filter prompt +- toggle case sensitivity: press ':' at empty filter prompt .Pp Common regex use cases: .Pp diff --git a/plugins/nuke b/plugins/nuke index 0ab1ae89..5fbf509d 100755 --- a/plugins/nuke +++ b/plugins/nuke @@ -13,6 +13,7 @@ # # export NNN_OPENER=nuke # 2. Run nnn with the program option to indicate a CLI opener # nnn -c +# # The -c program option overrides config `NNN_USE_EDITOR` # 3. nuke can use nnn plugins (e.g. mocplay is used for audio), $PATH is updated. # # Details: diff --git a/src/dbg.h b/src/dbg.h index 97d49ab9..3cb0b2b5 100644 --- a/src/dbg.h +++ b/src/dbg.h @@ -79,7 +79,7 @@ static void disabledbg(void) #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) -#define DPRINTF_D(x) xprintf(DEBUG_FD, "ln " TOSTRING(__LINE__) ": " #x "=%d\n", x, __LINE__) +#define DPRINTF_D(x) xprintf(DEBUG_FD, "ln " TOSTRING(__LINE__) ": " #x "=%d\n", x) #define DPRINTF_U(x) xprintf(DEBUG_FD, "ln " TOSTRING(__LINE__) ": " #x "=%u\n", x) #define DPRINTF_S(x) xprintf(DEBUG_FD, "ln " TOSTRING(__LINE__) ": " #x "=%s\n", x) #define DPRINTF_P(x) xprintf(DEBUG_FD, "ln " TOSTRING(__LINE__) ": " #x "=%p\n", x) diff --git a/src/nnn.c b/src/nnn.c index 699951b4..d2a1b546 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -129,6 +129,7 @@ #define READLINE_MAX 128 #define FILTER '/' #define RFILTER '\\' +#define CASE ':' #define MSGWAIT '$' #define REGEX_MAX 48 #define BM_MAX 10 @@ -2011,7 +2012,7 @@ static void showfilterinfo(void) { char info[REGEX_MAX]; - snprintf(info, REGEX_MAX - 1, " %s [/\\], %s [|]", + snprintf(info, REGEX_MAX - 1, " %s [/\\], %s [:]", (cfg.regex ? "regex" : "str"), ((fnstrstr == &strcasestr) ? "ic" : "noic")); printinfoln(info); @@ -2167,7 +2168,7 @@ static int filterentries(char *path, char *lastname) } /* Toggle case-sensitivity */ - if (*ch == '|') { + if (*ch == CASE) { fnstrstr = (fnstrstr == &strcasestr) ? &strstr : &strcasestr; regflags ^= REG_ICASE; showfilter(ln);