Commit a64257a8d27a1764ae2f100a989ba43ca552b64f

antirez 2016-04-12T18:44:46

Hints: when only bold is set, use color 37 (white).

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/linenoise.c b/linenoise.c
index 47ab864..368cd05 100644
--- a/linenoise.c
+++ b/linenoise.c
@@ -481,6 +481,7 @@ void refreshShowHints(struct abuf *ab, struct linenoiseState *l, int plen) {
             int hintlen = strlen(hint);
             int hintmaxlen = l->cols-(plen+l->len);
             if (hintlen > hintmaxlen) hintlen = hintmaxlen;
+            if (bold == 1 && color == -1) color = 37;
             if (color != -1 || bold != 0)
                 snprintf(seq,64,"\033[%d;%d;49m",bold,color);
             abAppend(ab,seq,strlen(seq));