2102f06
To: vim-dev@vim.org
2102f06
Subject: Patch 7.2.261
2102f06
Fcc: outbox
2102f06
From: Bram Moolenaar <Bram@moolenaar.net>
2102f06
Mime-Version: 1.0
2102f06
Content-Type: text/plain; charset=UTF-8
2102f06
Content-Transfer-Encoding: 8bit
2102f06
------------
2102f06
2102f06
Patch 7.2.261
2102f06
Problem:    When deleting lines with a specific folding configuration E38 may
2102f06
	    appear. (Shahaf)
2102f06
Solution:   When adjusting nested folds for deleted lines take into account
2102f06
	    that they don't start at the top of the enclosing fold.
2102f06
Files:	    src/fold.c
2102f06
2102f06
2102f06
*** ../vim-7.2.260/src/fold.c	2009-01-06 15:01:58.000000000 +0100
2102f06
--- src/fold.c	2009-09-18 14:43:23.000000000 +0200
2102f06
***************
2102f06
*** 1607,1617 ****
2102f06
  	    }
2102f06
  	    else
2102f06
  	    {
2102f06
- 		/* 2, 3, or 5: need to correct nested folds too */
2102f06
- 		foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top,
2102f06
- 				  line2 - fp->fd_top, amount, amount_after);
2102f06
  		if (fp->fd_top < top)
2102f06
  		{
2102f06
  		    if (last <= line2)
2102f06
  		    {
2102f06
  			/* 2. fold contains line1, line2 is below fold */
2102f06
--- 1607,1617 ----
2102f06
  	    }
2102f06
  	    else
2102f06
  	    {
2102f06
  		if (fp->fd_top < top)
2102f06
  		{
2102f06
+ 		    /* 2 or 3: need to correct nested folds too */
2102f06
+ 		    foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top,
2102f06
+ 				  line2 - fp->fd_top, amount, amount_after);
2102f06
  		    if (last <= line2)
2102f06
  		    {
2102f06
  			/* 2. fold contains line1, line2 is below fold */
2102f06
***************
2102f06
*** 1628,1634 ****
2102f06
  		}
2102f06
  		else
2102f06
  		{
2102f06
! 		    /* 5. fold is below line1 and contains line2 */
2102f06
  		    if (amount == MAXLNUM)
2102f06
  		    {
2102f06
  			fp->fd_len -= line2 - fp->fd_top + 1;
2102f06
--- 1628,1638 ----
2102f06
  		}
2102f06
  		else
2102f06
  		{
2102f06
! 		    /* 5. fold is below line1 and contains line2; need to
2102f06
! 		     * correct nested folds too */
2102f06
! 		    foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top,
2102f06
! 				  line2 - fp->fd_top, amount,
2102f06
! 				  amount_after + (fp->fd_top - top));
2102f06
  		    if (amount == MAXLNUM)
2102f06
  		    {
2102f06
  			fp->fd_len -= line2 - fp->fd_top + 1;
2102f06
*** ../vim-7.2.260/src/version.c	2009-09-18 14:58:26.000000000 +0200
2102f06
--- src/version.c	2009-09-18 15:14:40.000000000 +0200
2102f06
***************
2102f06
*** 678,679 ****
2102f06
--- 678,681 ----
2102f06
  {   /* Add new patch number below this line */
2102f06
+ /**/
2102f06
+     261,
2102f06
  /**/
2102f06
2102f06
-- 
2102f06
Emacs is a nice OS - but it lacks a good text editor.
2102f06
That's why I am using Vim.  --Anonymous
2102f06
2102f06
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
2102f06
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
2102f06
\\\        download, build and distribute -- http://www.A-A-P.org        ///
2102f06
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///