summaryrefslogtreecommitdiff
path: root/src/fold.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-02-03 18:14:49 +0100
committerBram Moolenaar <Bram@vim.org>2010-02-03 18:14:49 +0100
commitcee6a352b23c8e444d4e0f4a219c288da1b19f76 (patch)
tree1a858ccb15df37f17d79b1323579e755ef8d42e1 /src/fold.c
parent6427c608e7faac67417be39ce9a6ce752d17a71a (diff)
downloadvim-git-cee6a352b23c8e444d4e0f4a219c288da1b19f76.tar.gz
updated for version 7.2.356v7.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)
Diffstat (limited to 'src/fold.c')
-rw-r--r--src/fold.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fold.c b/src/fold.c
index 405a6ef1d..ff1139dcb 100644
--- 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;
}