Mercurial > vim
changeset 2092:98cc757f7e3d v7.2.376
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.
author | Bram Moolenaar <bram@zimbu.org> |
---|---|
date | Wed, 24 Feb 2010 17:22:20 +0100 |
parents | 95b659982b7c |
children | 0e4631bf9441 |
files | src/syntax.c src/version.c |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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);