summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/screen.c10
-rw-r--r--src/version.c2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/screen.c b/src/screen.c
index e11bdc377..d39513862 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -7588,6 +7588,12 @@ next_search_hl(win, shl, lnum, mincol, cur)
shl->lnum = lnum;
if (shl->rm.regprog != NULL)
{
+ /* Remember whether shl->rm is using a copy of the regprog in
+ * cur->match. */
+ int regprog_is_copy = (shl != &search_hl && cur != NULL
+ && shl == &cur->hl
+ && cur->match.regprog == cur->hl.rm.regprog);
+
nmatched = vim_regexec_multi(&shl->rm, win, shl->buf, lnum,
matchcol,
#ifdef FEAT_RELTIME
@@ -7596,6 +7602,10 @@ next_search_hl(win, shl, lnum, mincol, cur)
NULL
#endif
);
+ /* Copy the regprog, in case it got freed and recompiled. */
+ if (regprog_is_copy)
+ cur->match.regprog = cur->hl.rm.regprog;
+
if (called_emsg || got_int)
{
/* Error while handling regexp: stop using this regexp. */
diff --git a/src/version.c b/src/version.c
index a3adca86a..c674ce191 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 528,
+/**/
527,
/**/
526,