tweaks: and rename another variable, to keep in style
parent
e0bdf671b8
commit
414a1ecc8d
18
src/color.c
18
src/color.c
|
@ -398,7 +398,7 @@ void precalc_multicolorinfo(void)
|
||||||
{
|
{
|
||||||
const colortype *ink;
|
const colortype *ink;
|
||||||
regmatch_t startmatch, endmatch;
|
regmatch_t startmatch, endmatch;
|
||||||
filestruct *line, *endptr;
|
filestruct *line, *tailline;
|
||||||
|
|
||||||
if (openfile->colorstrings == NULL || ISSET(NO_COLOR_SYNTAX))
|
if (openfile->colorstrings == NULL || ISSET(NO_COLOR_SYNTAX))
|
||||||
return;
|
return;
|
||||||
|
@ -443,28 +443,28 @@ void precalc_multicolorinfo(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Look for an end match on later lines. */
|
/* Look for an end match on later lines. */
|
||||||
endptr = line->next;
|
tailline = line->next;
|
||||||
|
|
||||||
while (endptr != NULL) {
|
while (tailline != NULL) {
|
||||||
if (regexec(ink->end, endptr->data, 1, &endmatch, 0) == 0)
|
if (regexec(ink->end, tailline->data, 1, &endmatch, 0) == 0)
|
||||||
break;
|
break;
|
||||||
endptr = endptr->next;
|
tailline = tailline->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (endptr == NULL)
|
if (tailline == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* We found it, we found it, la la la la la. Mark all
|
/* We found it, we found it, la la la la la. Mark all
|
||||||
* the lines in between and the end properly. */
|
* the lines in between and the end properly. */
|
||||||
line->multidata[ink->id] = CENDAFTER;
|
line->multidata[ink->id] = CENDAFTER;
|
||||||
|
|
||||||
for (line = line->next; line != endptr; line = line->next) {
|
for (line = line->next; line != tailline; line = line->next) {
|
||||||
alloc_multidata_if_needed(line);
|
alloc_multidata_if_needed(line);
|
||||||
line->multidata[ink->id] = CWHOLELINE;
|
line->multidata[ink->id] = CWHOLELINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
alloc_multidata_if_needed(endptr);
|
alloc_multidata_if_needed(tailline);
|
||||||
line->multidata[ink->id] = CBEGINBEFORE;
|
tailline->multidata[ink->id] = CBEGINBEFORE;
|
||||||
|
|
||||||
/* Begin looking for a new start after the end match. */
|
/* Begin looking for a new start after the end match. */
|
||||||
index = endmatch.rm_eo;
|
index = endmatch.rm_eo;
|
||||||
|
|
Loading…
Reference in New Issue