浏览代码

Simpler questions for input

master
Arun Prakash Jana 6 年前
父节点
当前提交
f4f0b9dbba
共有 1 个文件被更改,包括 7 次插入6 次删除
  1. +7
    -6
      src/nnn.c

+ 7
- 6
src/nnn.c 查看文件

@@ -542,7 +542,7 @@ static int get_input(const char *prompt)


static char confirm_force() static char confirm_force()
{ {
int r = get_input("use force? (y/Y)"); int r = get_input("use force? [y/Y]");
if (r == 'y' || r == 'Y') if (r == 'y' || r == 'Y')
return 'f'; /* forceful */ return 'f'; /* forceful */


@@ -3077,7 +3077,7 @@ nochange:
if (sel == SEL_CYCLE) { if (sel == SEL_CYCLE) {
(r == CTX_MAX - 1) ? (r = 0) : ++r; (r == CTX_MAX - 1) ? (r = 0) : ++r;
snprintf(newpath, PATH_MAX, snprintf(newpath, PATH_MAX,
"Create context %d? (Enter)", r + 1); "Create context %d? [Enter]", r + 1);
fd = get_input(newpath); fd = get_input(newpath);
if (fd != '\r') if (fd != '\r')
continue; continue;
@@ -3512,8 +3512,8 @@ nochange:


/* Confirm if app is CLI or GUI */ /* Confirm if app is CLI or GUI */
if (sel == SEL_OPENWITH) { if (sel == SEL_OPENWITH) {
r = get_input("press 'c' for cli mode"); r = get_input("cli mode? [y/Y]");
(r == 'c') ? (r = F_NORMAL) : (r = F_NOWAIT | F_NOTRACE); (r == 'y' || r == 'Y') ? (r = F_NORMAL) : (r = F_NOWAIT | F_NOTRACE);
} }


switch (sel) { switch (sel) {
@@ -3565,7 +3565,8 @@ nochange:
if (faccessat(fd, tmp, F_OK, AT_SYMLINK_NOFOLLOW) != -1) { if (faccessat(fd, tmp, F_OK, AT_SYMLINK_NOFOLLOW) != -1) {
if (sel == SEL_RENAME) { if (sel == SEL_RENAME) {
/* Overwrite file with same name? */ /* Overwrite file with same name? */
if (get_input("press 'y' to overwrite") != 'y') { r = get_input("overwrite? [y/Y]");
if (r != 'y' && r != 'Y') {
close(fd); close(fd);
break; break;
} }
@@ -3726,7 +3727,7 @@ nochange:
case SEL_QUIT: case SEL_QUIT:
for (r = 0; r < CTX_MAX; ++r) for (r = 0; r < CTX_MAX; ++r)
if (r != cfg.curctx && g_ctx[r].c_cfg.ctxactive) { if (r != cfg.curctx && g_ctx[r].c_cfg.ctxactive) {
r = get_input("Quit all contexts? ('Enter' confirms)"); r = get_input("Quit all contexts? [Enter]");
break; break;
} }




||||||
x
 
000:0
正在加载...
取消
保存