Patch 7.4.901
Problem:    When a BufLeave autocommand changes folding in a way it syncs
            undo, undo can be corrupted.
Solution:   Prevent undo sync. (Jacob Niehus)
Files:      src/popupmnu.c


*** ../vim-7.4.900/src/popupmnu.c       2014-07-23 21:10:39.867766788 +0200
--- src/popupmnu.c      2015-10-30 14:19:21.681104047 +0100
***************
*** 568,574 ****
--- 568,578 ----
            if (p_pvh > 0 && p_pvh < g_do_tagpreview)
                g_do_tagpreview = p_pvh;
            ++RedrawingDisabled;
+           /* Prevent undo sync here, if an autocommand syncs undo weird
+            * things can happen to the undo tree. */
+           ++no_u_sync;
            resized = prepare_tagpreview(FALSE);
+           --no_u_sync;
            --RedrawingDisabled;
            g_do_tagpreview = 0;
  
***************
*** 659,665 ****
--- 663,671 ----
                         * redraw. */
                        if (resized)
                        {
+                           ++no_u_sync;
                            win_enter(curwin_save, TRUE);
+                           --no_u_sync;
                            update_topline();
                        }
  
***************
*** 670,676 ****
--- 676,686 ----
                        pum_do_redraw = FALSE;
  
                        if (!resized && win_valid(curwin_save))
+                       {
+                           ++no_u_sync;
                            win_enter(curwin_save, TRUE);
+                           --no_u_sync;
+                       }
  
                        /* May need to update the screen again when there are
                         * autocommands involved. */
*** ../vim-7.4.900/src/version.c        2015-10-25 22:41:56.703017233 +0100
--- src/version.c       2015-10-30 14:16:43.274962288 +0100
***************
*** 743,744 ****
--- 743,746 ----
  {   /* Add new patch number below this line */
+ /**/
+     901,
  /**/


-- 
Creating the world with Emacs:   M-x let-there-be-light
Creating the world with Vim:     :make world

 /// 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    ///

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui