mirror of
https://github.com/jarun/nnn.git
synced 2025-01-09 01:21:10 +00:00
Fix #351: reduce prompt length for new file/dir
This commit is contained in:
parent
b42efcbb1f
commit
a7d224f1e5
|
@ -4323,7 +4323,13 @@ nochange:
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case SEL_NEW:
|
case SEL_NEW:
|
||||||
tmp = xreadline(NULL, "name/link suffix [@ for none]: ");
|
r = get_input("create 'f'(ile) / 'd'(ir) / 's'(ym) / 'h'(ard)?");
|
||||||
|
if (r == 'f' || r == 'd') {
|
||||||
|
tmp = xreadline(NULL, "name: ");
|
||||||
|
} else if (r == 's' || r == 'h') {
|
||||||
|
tmp = xreadline(NULL, "link suffix [@ for none]: ");
|
||||||
|
} else
|
||||||
|
tmp = NULL;
|
||||||
break;
|
break;
|
||||||
default: /* SEL_RENAME */
|
default: /* SEL_RENAME */
|
||||||
tmp = xreadline(dents[cur].name, "");
|
tmp = xreadline(dents[cur].name, "");
|
||||||
|
@ -4424,7 +4430,6 @@ nochange:
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Check if it's a dir or file */
|
/* Check if it's a dir or file */
|
||||||
r = get_input("create 'f'(ile) / 'd'(ir) / 's'(ym) / 'h'(ard)?");
|
|
||||||
if (r == 'f') {
|
if (r == 'f') {
|
||||||
r = openat(fd, tmp, O_CREAT, 0666);
|
r = openat(fd, tmp, O_CREAT, 0666);
|
||||||
close(r);
|
close(r);
|
||||||
|
|
Loading…
Reference in a new issue