aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-03-15 19:51:54 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-03-15 19:52:02 +0530
commit03e6d7d553e6024d26b7ce51927c97f40e09925a (patch)
tree81e4d01bff0b1d328a32468146b32e1ac75362f5
parentc215c5de8087e1cc352f4f7f0d187231ac367a8c (diff)
downloadnnn-03e6d7d553e6024d26b7ce51927c97f40e09925a.tar.gz
Adapt PR #495
-rw-r--r--plugins/README.md1
-rw-r--r--src/nnn.c13
2 files changed, 7 insertions, 7 deletions
diff --git a/plugins/README.md b/plugins/README.md
index aa604fa..e4182e3 100644
--- a/plugins/README.md
+++ b/plugins/README.md
@@ -27,7 +27,6 @@ Plugins are installed to `${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins`.
| Plugin (a-z) | Description | Lang | Deps |
| --- | --- | --- | --- |
| autojump | Navigate to dir/path | sh | autojump |
-| batchrename | Batch rename selection or dir entries | sh | mktemp |
| boom | Play random music from dir | sh | [moc](http://moc.daper.net/) |
| dups | List non-empty duplicate files in current dir | sh | find, md5sum,<br>sort uniq xargs |
| chksum | Create and verify checksums | sh | md5sum,<br>sha256sum |
diff --git a/src/nnn.c b/src/nnn.c
index 26830ed..1e0933e 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -431,7 +431,7 @@ static uchar g_states;
#define UTIL_FZY 16
#define UTIL_NTFY 17
#define UTIL_CBCP 18
-#define UTIL_BATCHRENAME 19
+#define UTIL_NMV 19
/* Utilities to open files, run actions */
static char * const utils[] = {
@@ -470,7 +470,7 @@ static char * const utils[] = {
"fzy",
".ntfy",
".cbcp",
- "batchrename",
+ ".nmv",
};
/* Common strings */
@@ -4666,9 +4666,6 @@ static bool set_sort_flags(void)
{
int r = get_input(messages[MSG_ORDER]);
- if ((r == 'a' || r == 'd' || r == 'e' || r == 's' || r == 't') && (entrycmpfn == &reventrycmp))
- entrycmpfn = &entrycmp;
-
switch (r) {
case 'a': /* Apparent du */
cfg.apparentsz ^= 1;
@@ -4695,6 +4692,7 @@ static bool set_sort_flags(void)
cfg.mtimeorder = 0;
cfg.sizeorder = 0;
cfg.extnorder = 0;
+ entrycmpfn = &entrycmp;
clearfilter(); /* Reload directory */
endselection(); /* We are going to reload dir */
break;
@@ -4713,6 +4711,7 @@ static bool set_sort_flags(void)
cfg.mtimeorder = 0;
cfg.apparentsz = 0;
cfg.blkorder = 0;
+ entrycmpfn = &entrycmp;
break;
case 'r': /* Reverse sort */
entrycmpfn = (entrycmpfn == &entrycmp) ? &reventrycmp : &entrycmp;
@@ -4723,6 +4722,7 @@ static bool set_sort_flags(void)
cfg.apparentsz = 0;
cfg.blkorder = 0;
cfg.extnorder = 0;
+ entrycmpfn = &entrycmp;
break;
case 't': /* Modification or access time */
cfg.mtimeorder ^= 1;
@@ -4730,6 +4730,7 @@ static bool set_sort_flags(void)
cfg.apparentsz = 0;
cfg.blkorder = 0;
cfg.extnorder = 0;
+ entrycmpfn = &entrycmp;
break;
case 'v': /* Version */
namecmpfn = (namecmpfn == &xstrverscasecmp) ? &xstricmp : &xstrverscasecmp;
@@ -5609,7 +5610,7 @@ nochange:
case SEL_RENAMEMUL:
endselection();
- if (!plugscript(utils[UTIL_BATCHRENAME], newpath, path, F_CLI)
+ if (!plugscript(utils[UTIL_NMV], newpath, path, F_CLI)
&& !batch_rename(path)) {
printwait(messages[MSG_FAILED], &presel);
goto nochange;