To: [email protected]
Subject: Patch 7.4a.026
Fcc: outbox
From: Bram Moolenaar <[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4a.026
Problem:    ":diffoff" does not remove folds. (Ramel)
Solution:   Do not restore 'foldenable' when 'foldmethod' is "manual".
Files:      src/diff.c


*** ../vim-7.4a.025/src/diff.c  2013-07-03 15:23:18.000000000 +0200
--- src/diff.c  2013-07-17 13:43:15.000000000 +0200
***************
*** 1235,1244 ****
           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;
           foldUpdateAll(wp);
           /* make sure topline is not halfway a fold */
           changed_window_setting_win(wp);
--- 1235,1253 ----
           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_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);
*** ../vim-7.4a.025/src/version.c       2013-07-17 11:54:23.000000000 +0200
--- src/version.c       2013-07-17 13:40:11.000000000 +0200
***************
*** 729,730 ****
--- 729,732 ----
 {   /* Add new patch number below this line */
+ /**/
+     26,
 /**/

--
I recommend ordering large cargo containers of paper towels to make up
whatever budget underruns you have.  Paper products are always useful and they
have the advantage of being completely flushable if you need to make room in
the storage area later.
                               (Scott Adams - The Dilbert principle)

/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
\\\            help me help AIDS victims -- http://ICCF-Holland.org    ///