aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-10-11 18:38:06 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-10-11 18:38:06 +0530
commita7d224f1e5a063d15f8ef546aa54609344246750 (patch)
treead066a6b3c62d140f45b0509eee55b0cdf948a37 /src/nnn.c
parentb42efcbb1f774d801a46507887de4e023a96476d (diff)
downloadnnn-a7d224f1e5a063d15f8ef546aa54609344246750.tar.gz
Fix #351: reduce prompt length for new file/dir
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 374811d..8c8ee0b 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4323,7 +4323,13 @@ nochange:
#endif
break;
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;
default: /* SEL_RENAME */
tmp = xreadline(dents[cur].name, "");
@@ -4424,7 +4430,6 @@ nochange:
}
} else {
/* Check if it's a dir or file */
- r = get_input("create 'f'(ile) / 'd'(ir) / 's'(ym) / 'h'(ard)?");
if (r == 'f') {
r = openat(fd, tmp, O_CREAT, 0666);
close(r);