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 -- b...@moolenaar.net -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui