Commit a898fa5d authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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.
parent c0aa5ad2
No related merge requests found
Showing with 3 additions and 2 deletions
+3 -2
...@@ -2504,9 +2504,10 @@ void edit_draw(filestruct *fileptr, const char *converted, ...@@ -2504,9 +2504,10 @@ void edit_draw(filestruct *fileptr, const char *converted,
1, &endmatch, 0) == REG_NOMATCH) 1, &endmatch, 0) == REG_NOMATCH)
end_line = end_line->next; 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) 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) { if (end_line == fileptr && endmatch.rm_eo <= from_x) {
fileptr->multidata[varnish->id] = CBEGINBEFORE; fileptr->multidata[varnish->id] = CBEGINBEFORE;
goto step_two; goto step_two;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment