File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3268,6 +3268,7 @@ do_ecmd(
32683268 int did_get_winopts = FALSE;
32693269#endif
32703270 int readfile_flags = 0 ;
3271+ int did_inc_redrawing_disabled = FALSE;
32713272
32723273 if (eap != NULL )
32733274 command = eap -> do_ecmd_cmd ;
@@ -3600,6 +3601,11 @@ do_ecmd(
36003601 oldbuf = (flags & ECMD_OLDBUF );
36013602 }
36023603
3604+ /* Don't redraw until the cursor is in the right line, otherwise
3605+ * autocommands may cause ml_get errors. */
3606+ ++ RedrawingDisabled ;
3607+ did_inc_redrawing_disabled = TRUE;
3608+
36033609#ifdef FEAT_AUTOCMD
36043610 buf = curbuf ;
36053611#endif
@@ -3697,9 +3703,6 @@ do_ecmd(
36973703/*
36983704 * If we get here we are sure to start editing
36993705 */
3700- /* don't redraw until the cursor is in the right line */
3701- ++ RedrawingDisabled ;
3702-
37033706 /* Assume success now */
37043707 retval = OK ;
37053708
@@ -3899,6 +3902,7 @@ do_ecmd(
38993902#endif
39003903
39013904 -- RedrawingDisabled ;
3905+ did_inc_redrawing_disabled = FALSE;
39023906 if (!skip_redraw )
39033907 {
39043908 n = p_so ;
@@ -3933,6 +3937,8 @@ do_ecmd(
39333937#endif
39343938
39353939theend :
3940+ if (did_inc_redrawing_disabled )
3941+ -- RedrawingDisabled ;
39363942#ifdef FEAT_AUTOCMD
39373943 if (did_set_swapcommand )
39383944 set_vim_var_string (VV_SWAPCOMMAND , NULL , -1 );
Original file line number Diff line number Diff line change @@ -742,6 +742,8 @@ static char *(features[]) =
742742
743743static int included_patches [] =
744744{ /* Add new patch number below this line */
745+ /**/
746+ 1266 ,
745747/**/
746748 1265 ,
747749/**/
You can’t perform that action at this time.
0 commit comments