color: do not look for another 'end' match after already finding one
When reaching end-of-line after having found a zero-width end match,
nano should not continue at 'seek-an-end' but instead at 'step_two':
going on to seek a start match in the current line.
(There is no bug report, because I cannot figure out how to trigger
this issue and cause nano to misbehave. The problem was found while
reviewing the comments.)
Bug existed since commit 9a4a5454
from four years ago,
but the behavior was poorer before that commit.
master
parent
b202966d30
commit
895de17a58
|
@ -2602,7 +2602,7 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col)
|
||||||
if (startmatch.rm_so == startmatch.rm_eo &&
|
if (startmatch.rm_so == startmatch.rm_eo &&
|
||||||
endmatch.rm_so == endmatch.rm_eo) {
|
endmatch.rm_so == endmatch.rm_eo) {
|
||||||
if (start_line->data[index] == '\0')
|
if (start_line->data[index] == '\0')
|
||||||
break;
|
goto step_two;
|
||||||
index = step_right(start_line->data, index);
|
index = step_right(start_line->data, index);
|
||||||
}
|
}
|
||||||
/* If there is no later start on this line, next step. */
|
/* If there is no later start on this line, next step. */
|
||||||
|
|
Loading…
Reference in New Issue