mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 12:51:23 +03:00
painting: when finding an end match, set its multidata right away
When leaving the multidata unset (as was done until now) and the end match is offscreen, then this could lead to miscolorings later when jumping over this end match instead of scrolling past it. This fixes https://savannah.gnu.org/bugs/?60012. Bug existed since before version 2.1.10.
This commit is contained in:
parent
1fdd23d347
commit
7e04fea92b
11
src/winio.c
11
src/winio.c
@ -2500,7 +2500,7 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col)
|
||||
/* The match positions of a single-line regex. */
|
||||
const linestruct *start_line = line->prev;
|
||||
/* The first line before line that matches 'start'. */
|
||||
const linestruct *end_line = line;
|
||||
linestruct *end_line = line;
|
||||
/* The line that matches 'end'. */
|
||||
regmatch_t startmatch, endmatch;
|
||||
/* The match positions of the start and end regexes. */
|
||||
@ -2720,7 +2720,16 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col)
|
||||
wattron(edit, varnish->attributes);
|
||||
mvwaddnstr(edit, row, margin + start_col, thetext, -1);
|
||||
wattroff(edit, varnish->attributes);
|
||||
|
||||
line->multidata[varnish->id] = STARTSHERE;
|
||||
|
||||
if (end_line->multidata == NULL) {
|
||||
end_line->multidata = nmalloc(openfile->syntax->nmultis * sizeof(short));
|
||||
for (short item = 0; item < openfile->syntax->nmultis; item++)
|
||||
end_line->multidata[item] = 0;
|
||||
}
|
||||
end_line->multidata[varnish->id] = ENDSHERE;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user