]> granicus.if.org Git - vim/commitdiff
updated for version 7.2.356 v7.2.356
authorBram Moolenaar <Bram@vim.org>
Wed, 3 Feb 2010 17:14:49 +0000 (18:14 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 3 Feb 2010 17:14:49 +0000 (18:14 +0100)
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)

src/fold.c
src/version.c

index 405a6ef1d602ee15c0f66a3733ebe484fe75312f..ff1139dcb34b12d4f6de495393ebfb27fa192381 100644 (file)
@@ -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;
     }
 
index 91ae2ec9beef29beebaea734035c5f78cd8b69cd..b7aacc130a0c74d6bad75dcdf097b872f5664adf 100644 (file)
@@ -681,6 +681,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    356,
 /**/
     355,
 /**/