diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-02-24 17:22:20 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-02-24 17:22:20 +0100 |
commit | 72b73c12dc28e03a195f932c9f99bccfce92506a (patch) | |
tree | 1a16cb821541a3a358891db275daa59fb1a5564c /src/syntax.c | |
parent | 89c0ea4ea1724854764b87e07bccb0243caebdf6 (diff) | |
download | vim-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.c | 6 |
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); |