Patch 7.4.1266
Problem:    A BufAdd autocommand may cause an ml_get error (Christian
            Brabandt)
Solution:   Increment RedrawingDisabled earlier.
Files:      src/ex_cmds.c


*** ../vim-7.4.1265/src/ex_cmds.c       2016-01-31 14:55:35.223538514 +0100
--- src/ex_cmds.c       2016-02-06 15:21:16.845223019 +0100
***************
*** 3268,3273 ****
--- 3268,3274 ----
      int               did_get_winopts = FALSE;
  #endif
      int               readfile_flags = 0;
+     int               did_inc_redrawing_disabled = FALSE;
  
      if (eap != NULL)
        command = eap->do_ecmd_cmd;
***************
*** 3600,3605 ****
--- 3601,3611 ----
        oldbuf = (flags & ECMD_OLDBUF);
      }
  
+     /* Don't redraw until the cursor is in the right line, otherwise
+      * autocommands may cause ml_get errors. */
+     ++RedrawingDisabled;
+     did_inc_redrawing_disabled = TRUE;
+ 
  #ifdef FEAT_AUTOCMD
      buf = curbuf;
  #endif
***************
*** 3697,3705 ****
  /*
   * If we get here we are sure to start editing
   */
-     /* don't redraw until the cursor is in the right line */
-     ++RedrawingDisabled;
- 
      /* Assume success now */
      retval = OK;
  
--- 3703,3708 ----
***************
*** 3899,3904 ****
--- 3902,3908 ----
  #endif
  
      --RedrawingDisabled;
+     did_inc_redrawing_disabled = FALSE;
      if (!skip_redraw)
      {
        n = p_so;
***************
*** 3933,3938 ****
--- 3937,3944 ----
  #endif
  
  theend:
+     if (did_inc_redrawing_disabled)
+       --RedrawingDisabled;
  #ifdef FEAT_AUTOCMD
      if (did_set_swapcommand)
        set_vim_var_string(VV_SWAPCOMMAND, NULL, -1);
*** ../vim-7.4.1265/src/version.c       2016-02-05 23:09:07.385093906 +0100
--- src/version.c       2016-02-06 15:22:18.948573112 +0100
***************
*** 744,745 ****
--- 744,747 ----
  {   /* Add new patch number below this line */
+ /**/
+     1266,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
153. You find yourself staring at your "inbox" waiting for new e-mail
     to arrive.

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