提交 c54afb6d 编写于 作者: P Pieter Noordhuis

Minor update to linenoise

上级 b2cc45bf
......@@ -243,10 +243,14 @@ static int completeLine(int fd, const char *prompt, char *buf, size_t buflen, si
if (i == lc.len) beep();
break;
case 27: /* escape */
/* Re-show original buffer */
if (i < lc.len) {
refreshLine(fd,prompt,buf,*len,*pos,cols);
}
stop = 1;
break;
default:
/* update buffer and return */
/* Update buffer and return */
if (i < lc.len) {
nwritten = snprintf(buf,buflen,"%s",lc.cvec[i]);
*len = *pos = nwritten;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册