]> granicus.if.org Git - vim/commitdiff
updated for version 7.2.376 v7.2.376
authorBram Moolenaar <Bram@vim.org>
Wed, 24 Feb 2010 16:22:20 +0000 (17:22 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 24 Feb 2010 16:22:20 +0000 (17:22 +0100)
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.

src/syntax.c
src/version.c

index 42460585054fafaccb344c4655cb4fc7a7e87d11..355d41ce48247311e35566c3678f8922193fe6b0 100644 (file)
@@ -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);
index 9fc3f570bf0f245b60a8a36822712533c392f4e0..1eff44f1e5171352f036680a9f1fdd9fc1f07fca 100644 (file)
@@ -681,6 +681,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    376,
 /**/
     375,
 /**/