Commit 892ec0fe4c0189cd443f7f817768f07214cf84df

antirez 2013-02-08T00:12:01

Completion fixed (broken during refactoring).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/linenoise.c b/linenoise.c
index b3c0b96..8f1dcff 100644
--- a/linenoise.c
+++ b/linenoise.c
@@ -258,9 +258,11 @@ static int completeLine(struct linenoiseState *ls) {
                 struct linenoiseState saved = *ls;
 
                 ls->len = ls->pos = strlen(lc.cvec[i]);
+                ls->buf = lc.cvec[i];
                 refreshLine(ls);
                 ls->len = saved.len;
                 ls->pos = saved.pos;
+                ls->buf = saved.buf;
             } else {
                 refreshLine(ls);
             }