changeset 2071:8a0a8f10b43e v7.2.356

updated for version 7.2.356 Problem: When 'foldmethod' is changed not all folds are closed as expected. Solution: In foldUpdate() correct the start position and reset fd_flags when w_foldinvalid is set. (Lech Lorens)
author Bram Moolenaar <bram@zimbu.org>
date Wed, 03 Feb 2010 18:14:49 +0100
parents 4483ee552619
children 4a1bcdd9ea55
files src/fold.c src/version.c
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/fold.c
+++ b/src/fold.c
@@ -849,11 +849,17 @@ foldUpdate(wp, top, bot)
     fold_T	*fp;
 
     /* Mark all folds from top to bot as maybe-small. */
-    (void)foldFind(&curwin->w_folds, curwin->w_cursor.lnum, &fp);
+    (void)foldFind(&curwin->w_folds, top, &fp);
     while (fp < (fold_T *)curwin->w_folds.ga_data + curwin->w_folds.ga_len
 	    && fp->fd_top < bot)
     {
 	fp->fd_small = MAYBE;
+
+	/* Not sure if this is the right place to reset fd_flags (suggested by
+	 * Lech Lorens). */
+        if (wp->w_foldinvalid)
+            fp->fd_flags = FD_LEVEL;
+
 	++fp;
     }
 
--- a/src/version.c
+++ b/src/version.c
@@ -682,6 +682,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    356,
+/**/
     355,
 /**/
     354,