44ad545
To: vim-dev@vim.org
44ad545
Subject: Patch 7.2.376
44ad545
Fcc: outbox
44ad545
From: Bram Moolenaar <Bram@moolenaar.net>
44ad545
Mime-Version: 1.0
44ad545
Content-Type: text/plain; charset=UTF-8
44ad545
Content-Transfer-Encoding: 8bit
44ad545
------------
44ad545
44ad545
Patch 7.2.376
44ad545
Problem:    ml_get error when using SiSU syntax. (Nathan Thomas)
44ad545
Solution:   If the match ends below the last line move it to the end of the
44ad545
	    last line.
44ad545
Files:	    src/syntax.c
44ad545
44ad545
44ad545
*** ../vim-7.2.375/src/syntax.c	2010-01-19 14:59:14.000000000 +0100
44ad545
--- src/syntax.c	2010-02-24 17:14:13.000000000 +0100
44ad545
***************
44ad545
*** 3086,3091 ****
44ad545
--- 3086,3097 ----
44ad545
  	col = regmatch->startpos[0].col;
44ad545
  	off = spp->sp_offsets[idx];
44ad545
      }
44ad545
+     if (result->lnum > syn_buf->b_ml.ml_line_count)
44ad545
+     {
44ad545
+ 	/* a "\n" at the end of the pattern may take us below the last line */
44ad545
+ 	result->lnum = syn_buf->b_ml.ml_line_count;
44ad545
+ 	col = STRLEN(ml_get_buf(syn_buf, result->lnum, FALSE));
44ad545
+     }
44ad545
      if (off != 0)
44ad545
      {
44ad545
  	base = ml_get_buf(syn_buf, result->lnum, FALSE);
44ad545
*** ../vim-7.2.375/src/version.c	2010-02-24 16:58:30.000000000 +0100
44ad545
--- src/version.c	2010-02-24 17:15:48.000000000 +0100
44ad545
***************
44ad545
*** 683,684 ****
44ad545
--- 683,686 ----
44ad545
  {   /* Add new patch number below this line */
44ad545
+ /**/
44ad545
+     376,
44ad545
  /**/
44ad545
44ad545
-- 
44ad545
press CTRL-ALT-DEL for more information
44ad545
44ad545
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
44ad545
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
44ad545
\\\        download, build and distribute -- http://www.A-A-P.org        ///
44ad545
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///