+2015-07-18 Benno Schulenberg <bensberg@justemail.net>
+ * src/winio.c (edit_draw): When looking for multiline-regex matches,
+ look for a new start only after an end, instead of right after the
+ last start. This fixes bug #45525 and bug #41313 on Savannah.
+
2015-07-17 Benno Schulenberg <bensberg@justemail.net>
* src/files.c (open_buffer): Verify that a named and existing file
is a normal file, to avoid opening an empty buffer when the name of
/* If the found start has been qualified as an end earlier,
* believe it and skip to the next step. */
if (start_line != NULL && start_line->multidata != NULL &&
- start_line->multidata[tmpcolor->id] == CBEGINBEFORE)
+ (start_line->multidata[tmpcolor->id] == CBEGINBEFORE ||
+ start_line->multidata[tmpcolor->id] == CSTARTENDHERE))
goto step_two;
/* Skip over a zero-length regex match. */
if (paintlen < 0)
goto end_of_loop;
step_two:
- /* Second step, we look for starts on this line. */
- start_col = 0;
+ /* Second step: look for starts on this line, but start
+ * looking only after an end match, if there is one. */
+ start_col = (paintlen == 0) ? 0 : endmatch.rm_eo;
while (start_col < endpos) {
if (regexec(tmpcolor->start, fileptr->data +
#endif
}
}
+ start_col = endmatch.rm_eo;
} else {
/* There is no end on this line. But we
* haven't yet looked for one on later
fileptr->multidata[tmpcolor->id] = CENDAFTER;
break;
}
+ start_col = startmatch.rm_so + 1;
}
- start_col = startmatch.rm_so + 1;
}
}
}