Skip to content

Commit

Permalink
Cli highlighting fix (#4773)
Browse files Browse the repository at this point in the history
* Fixed cli highlighting error

* updated comment
  • Loading branch information
MSebanc authored Jan 23, 2025
1 parent 9cb276f commit bdb428b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tools/shell/linenoise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1760,8 +1760,7 @@ void addErrorHighlighting(uint64_t render_start, uint64_t render_end,
case ScanState::IN_SINGLE_QUOTE:
// single quote - all that will get us out is an unescaped single-quote
if (c == '\'') {
if (i + 1 < l->len && l->buf[i + 1] == '\'') {
// double single-quote means the quote is escaped - continue
if (i > 0 && l->buf[i - 1] == '\\') { // escaped quote
i++;
break;
} else {
Expand All @@ -1774,8 +1773,7 @@ void addErrorHighlighting(uint64_t render_start, uint64_t render_end,
case ScanState::IN_DOUBLE_QUOTE:
// double quote - all that will get us out is an unescaped quote
if (c == '"') {
if (i + 1 < l->len && l->buf[i + 1] == '"') {
// double quote means the quote is escaped - continue
if (i > 0 && l->buf[i - 1] == '\\') { // escaped quote
i++;
break;
} else {
Expand Down

0 comments on commit bdb428b

Please sign in to comment.