mirror of
https://github.com/jarun/nnn.git
synced 2024-11-19 01:19:14 +00:00
Keep name unchanged at rename to duplicate
This commit is contained in:
parent
bf13243830
commit
f378743c49
18
src/nnn.c
18
src/nnn.c
|
@ -4235,13 +4235,8 @@ nochange:
|
||||||
tmp = xreadline(NULL, "name/link suffix [@ for none]: ");
|
tmp = xreadline(NULL, "name/link suffix [@ for none]: ");
|
||||||
break;
|
break;
|
||||||
default: /* SEL_RENAME */
|
default: /* SEL_RENAME */
|
||||||
dup = get_input("Press 'r'(ename) / 'd'(uplicate)");
|
tmp = xreadline(dents[cur].name, "");
|
||||||
if (dup == 'r' || dup == 'd') {
|
break;
|
||||||
tmp = xreadline(dents[cur].name, "");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
tmp = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tmp || !*tmp)
|
if (!tmp || !*tmp)
|
||||||
|
@ -4278,8 +4273,13 @@ nochange:
|
||||||
break;
|
break;
|
||||||
case SEL_RENAME:
|
case SEL_RENAME:
|
||||||
/* Skip renaming to same name */
|
/* Skip renaming to same name */
|
||||||
if (strcmp(tmp, dents[cur].name) == 0)
|
if (strcmp(tmp, dents[cur].name) == 0) {
|
||||||
goto nochange;
|
tmp = xreadline(dents[cur].name, "copy name: ");
|
||||||
|
if (strcmp(tmp, dents[cur].name) == 0)
|
||||||
|
goto nochange;
|
||||||
|
|
||||||
|
dup = 'd';
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue