]> granicus.if.org Git - vim/commitdiff
updated for version 7.2.370 v7.2.370
authorBram Moolenaar <Bram@vim.org>
Wed, 24 Feb 2010 13:34:19 +0000 (14:34 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 24 Feb 2010 13:34:19 +0000 (14:34 +0100)
Problem:    A redraw may cause folds to be closed.
Solution:   Revert part of the previous patch.  Add a test. (Lech Lorens)

src/diff.c
src/fold.c
src/option.c
src/testdir/test45.in
src/testdir/test45.ok
src/version.c

index f5ea0c69285a1b2afa21b04508af190b3580b13a..bf6254598f913639a05dafae31298ad47616ce89 100644 (file)
@@ -1117,26 +1117,31 @@ diff_win_options(wp, addbuf)
     win_T      *wp;
     int                addbuf;         /* Add buffer to diff. */
 {
+# ifdef FEAT_FOLDING
+    win_T *old_curwin = curwin;
+
+    /* close the manually opened folds */
+    curwin = wp;
+    newFoldLevel();
+    curwin = old_curwin;
+# endif
+
     wp->w_p_diff = TRUE;
     wp->w_p_scb = TRUE;
     wp->w_p_wrap = FALSE;
 # ifdef FEAT_FOLDING
-    {
-       win_T       *old_curwin = curwin;
-
-       curwin = wp;
-       curbuf = curwin->w_buffer;
-       set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff",
+    curwin = wp;
+    curbuf = curwin->w_buffer;
+    set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff",
                                                       OPT_LOCAL|OPT_FREE, 0);
-       curwin = old_curwin;
-       curbuf = curwin->w_buffer;
-       wp->w_p_fdc = diff_foldcolumn;
-       wp->w_p_fen = TRUE;
-       wp->w_p_fdl = 0;
-       foldUpdateAll(wp);
-       /* make sure topline is not halfway a fold */
-       changed_window_setting_win(wp);
-    }
+    curwin = old_curwin;
+    curbuf = curwin->w_buffer;
+    wp->w_p_fdc = diff_foldcolumn;
+    wp->w_p_fen = TRUE;
+    wp->w_p_fdl = 0;
+    foldUpdateAll(wp);
+    /* make sure topline is not halfway a fold */
+    changed_window_setting_win(wp);
 # endif
 #ifdef FEAT_SCROLLBIND
     if (vim_strchr(p_sbo, 'h') == NULL)
index ff1139dcb34b12d4f6de495393ebfb27fa192381..a23a35c2aadc6a7f0274909b62dfebe94313af95 100644 (file)
@@ -854,12 +854,6 @@ foldUpdate(wp, top, bot)
            && 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 99e94d5e0d598f5bc835560c3e2c16aaaa7bdde0..ba17c1151c3549b15ab5b8d57a23fb80c3a407c9 100644 (file)
@@ -6586,7 +6586,11 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
                || *curwin->w_p_fdm == NUL)
            errmsg = e_invarg;
        else
+       {
            foldUpdateAll(curwin);
+           if (foldmethodIsDiff(curwin))
+               newFoldLevel();
+       }
     }
 # ifdef FEAT_EVAL
     /* 'foldexpr' */
index 1dfad5454fc4e7cbec72614f978219c8a4774f61..e5af5073d909998feb70164aa0f080821f65076c 100644 (file)
@@ -36,6 +36,8 @@ Gzk:call append("$", "folding " . getline("."))
 k:call append("$", getline("."))
 jAcommentstart  \eAcommentend\e:set fdl=1
 3j:call append("$", getline("."))
+:set fdl=0
+zO\fj:call append("$", getline("."))
 :" test expression folding
 :fun Flvl()
   let l = getline(v:lnum)
index 713cf882ec8f27b52a85eb54f3d9267255de5b1e..f04996e337eeae186140330c184c89f1335f0c7f 100644 (file)
@@ -11,6 +11,7 @@ indent 2
 folding 9 ii
     3 cc
 7 gg
+8 hh
 expr 2
 1
 2
index cbdcf2e9010728c496b541855bbaf214b89dba36..212e34d767fcc87b4327c25b82e2d48d92aca1cf 100644 (file)
@@ -681,6 +681,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    370,
 /**/
     369,
 /**/