diff --git a/src/syntax.c b/src/syntax.c index 4246058505..355d41ce48 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -3086,6 +3086,12 @@ syn_add_start_off(result, regmatch, spp, idx, extra) col = regmatch->startpos[0].col; off = spp->sp_offsets[idx]; } + if (result->lnum > syn_buf->b_ml.ml_line_count) + { + /* a "\n" at the end of the pattern may take us below the last line */ + result->lnum = syn_buf->b_ml.ml_line_count; + col = STRLEN(ml_get_buf(syn_buf, result->lnum, FALSE)); + } if (off != 0) { base = ml_get_buf(syn_buf, result->lnum, FALSE); diff --git a/src/version.c b/src/version.c index 9fc3f570bf..1eff44f1e5 100644 --- a/src/version.c +++ b/src/version.c @@ -681,6 +681,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 376, /**/ 375, /**/