diff --git a/src/color.c b/src/color.c index d0a8a946a387602266e07958fb7807c21da6d079..97a9d0404bf603e00a5417e3d304bcd1ed63918c 100644 --- a/src/color.c +++ b/src/color.c @@ -370,6 +370,9 @@ void reset_multis(filestruct *fileptr, bool force) } } + refresh_needed = TRUE; + return; + /* If we got here, things have changed. */ reset_multis_for_id(fileptr, ink->id); diff --git a/src/winio.c b/src/winio.c index f74f3f4875cfa8e6a36d142ebe9220f5fba2cf41..97f6c16bafbaf3fc1eb68a24a63d4ca1b103b603 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2420,6 +2420,22 @@ void edit_draw(filestruct *fileptr, const char *converted, regmatch_t startmatch, endmatch; /* The match positions of the start and end regexes. */ + /* First check the multidata of the preceding line -- it tells + * us about the situation so far, and thus what to do here. */ + if (start_line != NULL && start_line->multidata != NULL) { + if (start_line->multidata[varnish->id] == CWHOLELINE || + start_line->multidata[varnish->id] == CENDAFTER) { + fileptr->multidata[varnish->id] = CNONE; + goto seek_an_end; + } + if (start_line->multidata[varnish->id] == CNONE || + start_line->multidata[varnish->id] == CBEGINBEFORE || + start_line->multidata[varnish->id] == CSTARTENDHERE) { + fileptr->multidata[varnish->id] = CNONE; + goto step_two; + } + } + /* First see if the multidata was maybe already calculated. */ if (fileptr->multidata[varnish->id] == CNONE) goto tail_of_loop; @@ -2440,10 +2456,8 @@ void edit_draw(filestruct *fileptr, const char *converted, /* There is no precalculated multidata, or it is CENDAFTER or * CSTARTENDHERE. In all cases, find out what to paint. */ - /* When the multidata is unitialized, assume CNONE until one - * of the steps below concludes otherwise. */ - if (fileptr->multidata[varnish->id] == -1) - fileptr->multidata[varnish->id] = CNONE; + /* Assume nothing gets painted until proven otherwise below. */ + fileptr->multidata[varnish->id] = CNONE; /* First check if the beginning of the line is colored by a * start on an earlier line, and an end on this line or later. @@ -2500,6 +2514,7 @@ void edit_draw(filestruct *fileptr, const char *converted, } /* Indeed, there is a start without an end on that line. */ + seek_an_end: /* We've already checked that there is no end between the start * and the current line. But is there an end after the start * at all? We don't paint unterminated starts. */