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