# HG changeset patch # User Bram Moolenaar # Date 1267028540 -3600 # Node ID 98cc757f7e3dbff20ade108b82582d7a7d88ed33 # Parent 95b659982b7c17ff93304a37f43be8dc508e20dd updated for version 7.2.376 Problem: ml_get error when using SiSU syntax. (Nathan Thomas) Solution: If the match ends below the last line move it to the end of the last line. diff --git a/src/syntax.c b/src/syntax.c --- a/src/syntax.c +++ b/src/syntax.c @@ -3086,6 +3086,12 @@ syn_add_start_off(result, regmatch, spp, 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 --- a/src/version.c +++ b/src/version.c @@ -682,6 +682,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 376, +/**/ 375, /**/ 374,