From f378743c4962e0c69eadec0ef0d329f9efd63d71 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Mon, 19 Aug 2019 19:58:37 +0530 Subject: [PATCH] Keep name unchanged at rename to duplicate --- src/nnn.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/nnn.c b/src/nnn.c index aef492a7..6e529781 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -4235,13 +4235,8 @@ nochange: tmp = xreadline(NULL, "name/link suffix [@ for none]: "); break; default: /* SEL_RENAME */ - dup = get_input("Press 'r'(ename) / 'd'(uplicate)"); - if (dup == 'r' || dup == 'd') { - tmp = xreadline(dents[cur].name, ""); - break; - } - - tmp = NULL; + tmp = xreadline(dents[cur].name, ""); + break; } if (!tmp || !*tmp) @@ -4278,8 +4273,13 @@ nochange: break; case SEL_RENAME: /* Skip renaming to same name */ - if (strcmp(tmp, dents[cur].name) == 0) - goto nochange; + if (strcmp(tmp, dents[cur].name) == 0) { + tmp = xreadline(dents[cur].name, "copy name: "); + if (strcmp(tmp, dents[cur].name) == 0) + goto nochange; + + dup = 'd'; + } break; default: break;