tweaks: if there is no end match, there is nothing to paint

When there is no end match after a start, it is pointless to look
for any more starts because also they will not have any end match,
so nothing will get painted -- just cut the loop short.
master
Benno Schulenberg 2017-01-09 19:14:51 +01:00
parent c0aa5ad258
commit a898fa5dcc
1 changed files with 3 additions and 2 deletions

View File

@ -2504,9 +2504,10 @@ void edit_draw(filestruct *fileptr, const char *converted,
1, &endmatch, 0) == REG_NOMATCH)
end_line = end_line->next;
/* If no end was found, or it is too early, next step. */
/* If there is no end, there is nothing to paint. */
if (end_line == NULL)
goto step_two;
goto tail_of_loop;
/* If the end is scrolled off to the left, next step. */
if (end_line == fileptr && endmatch.rm_eo <= from_x) {
fileptr->multidata[varnish->id] = CBEGINBEFORE;
goto step_two;