Browse Source

Use : for filter case

master
Arun Prakash Jana 5 years ago
parent
commit
99d15815f0
No known key found for this signature in database GPG Key ID: A75979F35C080412
4 changed files with 6 additions and 4 deletions
  1. +1
    -1
      nnn.1
  2. +1
    -0
      plugins/nuke
  3. +1
    -1
      src/dbg.h
  4. +3
    -2
      src/nnn.c

+ 1
- 1
nnn.1 View File

@@ -146,7 +146,7 @@ To modify match criteria at runtime:
.br .br
- regex to string: press '/' at empty filter prompt - regex to string: press '/' at empty filter prompt
.br .br
- toggle case sensitivity: press '|' at empty filter prompt - toggle case sensitivity: press ':' at empty filter prompt
.Pp .Pp
Common regex use cases: Common regex use cases:
.Pp .Pp


+ 1
- 0
plugins/nuke View File

@@ -13,6 +13,7 @@
# # export NNN_OPENER=nuke # # export NNN_OPENER=nuke
# 2. Run nnn with the program option to indicate a CLI opener # 2. Run nnn with the program option to indicate a CLI opener
# nnn -c # 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. # 3. nuke can use nnn plugins (e.g. mocplay is used for audio), $PATH is updated.
# #
# Details: # Details:


+ 1
- 1
src/dbg.h View File

@@ -79,7 +79,7 @@ static void disabledbg(void)
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(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_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_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) #define DPRINTF_P(x) xprintf(DEBUG_FD, "ln " TOSTRING(__LINE__) ": " #x "=%p\n", x)


+ 3
- 2
src/nnn.c View File

@@ -129,6 +129,7 @@
#define READLINE_MAX 128 #define READLINE_MAX 128
#define FILTER '/' #define FILTER '/'
#define RFILTER '\\' #define RFILTER '\\'
#define CASE ':'
#define MSGWAIT '$' #define MSGWAIT '$'
#define REGEX_MAX 48 #define REGEX_MAX 48
#define BM_MAX 10 #define BM_MAX 10
@@ -2011,7 +2012,7 @@ static void showfilterinfo(void)
{ {
char info[REGEX_MAX]; char info[REGEX_MAX];


snprintf(info, REGEX_MAX - 1, " %s [/\\], %s [|]", snprintf(info, REGEX_MAX - 1, " %s [/\\], %s [:]",
(cfg.regex ? "regex" : "str"), (cfg.regex ? "regex" : "str"),
((fnstrstr == &strcasestr) ? "ic" : "noic")); ((fnstrstr == &strcasestr) ? "ic" : "noic"));
printinfoln(info); printinfoln(info);
@@ -2167,7 +2168,7 @@ static int filterentries(char *path, char *lastname)
} }


/* Toggle case-sensitivity */ /* Toggle case-sensitivity */
if (*ch == '|') { if (*ch == CASE) {
fnstrstr = (fnstrstr == &strcasestr) ? &strstr : &strcasestr; fnstrstr = (fnstrstr == &strcasestr) ? &strstr : &strcasestr;
regflags ^= REG_ICASE; regflags ^= REG_ICASE;
showfilter(ln); showfilter(ln);


||||||
x
 
000:0
Loading…
Cancel
Save