summaryrefslogtreecommitdiff
path: root/src/syntax.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-02-24 17:22:20 +0100
committerBram Moolenaar <Bram@vim.org>2010-02-24 17:22:20 +0100
commit72b73c12dc28e03a195f932c9f99bccfce92506a (patch)
tree1a16cb821541a3a358891db275daa59fb1a5564c /src/syntax.c
parent89c0ea4ea1724854764b87e07bccb0243caebdf6 (diff)
downloadvim-git-72b73c12dc28e03a195f932c9f99bccfce92506a.tar.gz
updated for version 7.2.376v7.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.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 424605850..355d41ce4 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);