Skip to content

Commit

Permalink
Merge pull request #151 from hoelzro/master
Browse files Browse the repository at this point in the history
Set seq to empty string if color/bold not used
  • Loading branch information
antirez authored Jul 18, 2018
2 parents cc2ea63 + b12f6ba commit 4a961c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions linenoise.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ void refreshShowHints(struct abuf *ab, struct linenoiseState *l, int plen) {
if (bold == 1 && color == -1) color = 37;
if (color != -1 || bold != 0)
snprintf(seq,64,"\033[%d;%d;49m",bold,color);
else
seq[0] = '\0';
abAppend(ab,seq,strlen(seq));
abAppend(ab,hint,hintlen);
if (color != -1 || bold != 0)
Expand Down

0 comments on commit 4a961c0

Please sign in to comment.