]> git.saurik.com Git - redis.git/commitdiff
Minor update to linenoise
authorPieter Noordhuis <pcnoordhuis@gmail.com>
Mon, 29 Nov 2010 19:53:57 +0000 (20:53 +0100)
committerPieter Noordhuis <pcnoordhuis@gmail.com>
Mon, 29 Nov 2010 19:53:57 +0000 (20:53 +0100)
deps/linenoise/linenoise.c

index 0ebef2e910f8772cfc9c35a7d5d858c227bccef5..b6f4d4f9bfbc2b0bcd579002d531179a1d39e6cb 100644 (file)
@@ -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;