diff options
author | antirez <antirez@gmail.com> | 2016-04-13 12:34:14 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2016-05-02 08:42:32 +0200 |
commit | 3fd3fca0dd38cb21c900e4ba98e3d41f333335aa (patch) | |
tree | 870eb59f8c75f189f6dae07d91704403ee632f7a /deps | |
parent | 34354473ffe8d60b80acdbc8c16b194f8bbd70a0 (diff) | |
download | redis-3fd3fca0dd38cb21c900e4ba98e3d41f333335aa.tar.gz |
redis-cli hints.
Diffstat (limited to 'deps')
-rw-r--r-- | deps/linenoise/linenoise.c | 8 | ||||
-rw-r--r-- | deps/linenoise/linenoise.h | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/deps/linenoise/linenoise.c b/deps/linenoise/linenoise.c index 368cd05c7..a807d9b8a 100644 --- a/deps/linenoise/linenoise.c +++ b/deps/linenoise/linenoise.c @@ -815,6 +815,14 @@ static int linenoiseEdit(int stdin_fd, int stdout_fd, char *buf, size_t buflen, history_len--; free(history[history_len]); if (mlmode) linenoiseEditMoveEnd(&l); + if (hintsCallback) { + /* Force a refresh without hints to leave the previous + * line as the user typed it after a newline. */ + linenoiseHintsCallback *hc = hintsCallback; + hintsCallback = NULL; + refreshLine(&l); + hintsCallback = hc; + } return (int)l.len; case CTRL_C: /* ctrl-c */ errno = EAGAIN; diff --git a/deps/linenoise/linenoise.h b/deps/linenoise/linenoise.h index 3138c1f20..ed20232c5 100644 --- a/deps/linenoise/linenoise.h +++ b/deps/linenoise/linenoise.h @@ -50,7 +50,7 @@ typedef struct linenoiseCompletions { typedef void(linenoiseCompletionCallback)(const char *, linenoiseCompletions *); typedef char*(linenoiseHintsCallback)(const char *, int *color, int *bold); -typedef char*(linenoiseFreeHintsCallback)(char *); +typedef void(linenoiseFreeHintsCallback)(void *); void linenoiseSetCompletionCallback(linenoiseCompletionCallback *); void linenoiseSetHintsCallback(linenoiseHintsCallback *); void linenoiseSetFreeHintsCallback(linenoiseFreeHintsCallback *); |