浏览代码

Fix https://github.com/mcchrish/nnn.vim/issues/39

If nnn is started in the picker mode, do NOT use libreadline.
Fallback to the stock mechanism to show the command prompt.
master
Arun Prakash Jana 6 年前
父节点
当前提交
929edaf243
找不到此签名对应的密钥 GPG 密钥 ID: A75979F35C080412
共有 1 个文件被更改,包括 22 次插入14 次删除
  1. +22
    -14
      src/nnn.c

+ 22
- 14
src/nnn.c 查看文件

@@ -3888,27 +3888,35 @@ nochange:
}
break;
default: /* SEL_RUNCMD */
exitcurses();
if (cfg.picker)
tmp = xreadline(NULL, "> ");
else {
/* Use libreadline */
exitcurses();

/* Switch to current path for readline(3) */
if (chdir(path) == -1) {
printwarn();
goto nochange;
}

/* Switch to current path for readline(3) */
if (chdir(path) == -1) {
printwarn();
goto nochange;
}
tmp = readline("nnn> ");

tmp = readline("nnn> ");
if (chdir(ipath) == -1) {
printwarn();
goto nochange;
}

if (chdir(ipath) == -1) {
printwarn();
goto nochange;
refresh();
}

refresh();

if (tmp && tmp[0]) {
spawn(shell, "-c", tmp, path, F_NORMAL | F_SIGINT);
add_history(tmp);
free(tmp);
if (!cfg.picker) {
/* readline finishing touches */
add_history(tmp);
free(tmp);
}
}
}



正在加载...
取消
保存