Karsten Hopp 736809
To: vim-dev@vim.org
Karsten Hopp 736809
Subject: Patch 7.2.356
Karsten Hopp 736809
Fcc: outbox
Karsten Hopp 736809
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 736809
Mime-Version: 1.0
Karsten Hopp 736809
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 736809
Content-Transfer-Encoding: 8bit
Karsten Hopp 736809
------------
Karsten Hopp 736809
Karsten Hopp 736809
Patch 7.2.356
Karsten Hopp 736809
Problem:    When 'foldmethod' is changed not all folds are closed as expected.
Karsten Hopp 736809
Solution:   In foldUpdate() correct the start position and reset fd_flags when
Karsten Hopp 736809
	    w_foldinvalid is set. (Lech Lorens)
Karsten Hopp 736809
Files:	    src/fold.c
Karsten Hopp 736809
Karsten Hopp 736809
Karsten Hopp 736809
*** ../vim-7.2.355/src/fold.c	2010-01-19 17:24:20.000000000 +0100
Karsten Hopp 736809
--- src/fold.c	2010-02-03 18:08:11.000000000 +0100
Karsten Hopp 736809
***************
Karsten Hopp 736809
*** 849,859 ****
Karsten Hopp 736809
      fold_T	*fp;
Karsten Hopp 736809
  
Karsten Hopp 736809
      /* Mark all folds from top to bot as maybe-small. */
Karsten Hopp 736809
!     (void)foldFind(&curwin->w_folds, curwin->w_cursor.lnum, &fp);
Karsten Hopp 736809
      while (fp < (fold_T *)curwin->w_folds.ga_data + curwin->w_folds.ga_len
Karsten Hopp 736809
  	    && fp->fd_top < bot)
Karsten Hopp 736809
      {
Karsten Hopp 736809
  	fp->fd_small = MAYBE;
Karsten Hopp 736809
  	++fp;
Karsten Hopp 736809
      }
Karsten Hopp 736809
  
Karsten Hopp 736809
--- 849,865 ----
Karsten Hopp 736809
      fold_T	*fp;
Karsten Hopp 736809
  
Karsten Hopp 736809
      /* Mark all folds from top to bot as maybe-small. */
Karsten Hopp 736809
!     (void)foldFind(&curwin->w_folds, top, &fp);
Karsten Hopp 736809
      while (fp < (fold_T *)curwin->w_folds.ga_data + curwin->w_folds.ga_len
Karsten Hopp 736809
  	    && fp->fd_top < bot)
Karsten Hopp 736809
      {
Karsten Hopp 736809
  	fp->fd_small = MAYBE;
Karsten Hopp 736809
+ 
Karsten Hopp 736809
+ 	/* Not sure if this is the right place to reset fd_flags (suggested by
Karsten Hopp 736809
+ 	 * Lech Lorens). */
Karsten Hopp 736809
+         if (wp->w_foldinvalid)
Karsten Hopp 736809
+             fp->fd_flags = FD_LEVEL;
Karsten Hopp 736809
+ 
Karsten Hopp 736809
  	++fp;
Karsten Hopp 736809
      }
Karsten Hopp 736809
  
Karsten Hopp 736809
*** ../vim-7.2.355/src/version.c	2010-02-03 17:42:59.000000000 +0100
Karsten Hopp 736809
--- src/version.c	2010-02-03 18:12:34.000000000 +0100
Karsten Hopp 736809
***************
Karsten Hopp 736809
*** 683,684 ****
Karsten Hopp 736809
--- 683,686 ----
Karsten Hopp 736809
  {   /* Add new patch number below this line */
Karsten Hopp 736809
+ /**/
Karsten Hopp 736809
+     356,
Karsten Hopp 736809
  /**/
Karsten Hopp 736809
Karsten Hopp 736809
-- 
Karsten Hopp 736809
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 736809
190. You quickly hand over your wallet, leather jacket, and car keys
Karsten Hopp 736809
     during a mugging, then proceed to beat the crap out of your
Karsten Hopp 736809
     assailant when he asks for your laptop.
Karsten Hopp 736809
Karsten Hopp 736809
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 736809
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 736809
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 736809
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///