]> granicus.if.org Git - vim/commitdiff
updated for version 7.4a.026 v7.4a.026
authorBram Moolenaar <Bram@vim.org>
Wed, 17 Jul 2013 11:43:39 +0000 (13:43 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 17 Jul 2013 11:43:39 +0000 (13:43 +0200)
Problem:    ":diffoff" does not remove folds. (Ramel)
Solution:   Do not restore 'foldenable' when 'foldmethod' is "manual".

src/diff.c
src/version.c

index 92648a36153614e8a6a8681afdb7cad5a43e476e..80f447314432703aec33f8550429e69033d011a6 100644 (file)
@@ -1235,10 +1235,19 @@ ex_diffoff(eap)
            curbuf = curwin->w_buffer;
            if (wp->w_p_fdc == diff_foldcolumn)
                wp->w_p_fdc = wp->w_p_diff_saved ? wp->w_p_fdc_save : 0;
-           if (wp->w_p_fen)
-               wp->w_p_fen = wp->w_p_diff_saved ? wp->w_p_fen_save : FALSE;
            if (wp->w_p_fdl == 0 && wp->w_p_diff_saved)
                wp->w_p_fdl = wp->w_p_fdl_save;
+
+           if (wp->w_p_fen)
+           {
+               /* Only restore 'foldenable' when 'foldmethod' is not
+                * "manual", otherwise we continue to show the diff folds. */
+               if (foldmethodIsManual(wp) || !wp->w_p_diff_saved)
+                   wp->w_p_fen = FALSE;
+               else
+                   wp->w_p_fen = wp->w_p_fen_save;
+           }
+
            foldUpdateAll(wp);
            /* make sure topline is not halfway a fold */
            changed_window_setting_win(wp);
index 558649b82f764464fbe7049f02e412458b319f12..eb48ddd257161ddf14b0da3d68dccc5e3431dac1 100644 (file)
@@ -727,6 +727,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    26,
 /**/
     25,
 /**/