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