mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
vim-patch 7.4.1266
Problem: A BufAdd autocommand may cause an ml_get error (Christian
Brabandt)
Solution: Increment RedrawingDisabled earlier.
ab9fc7e0cf
This commit is contained in:

committed by
James McCoy

parent
4a6b4bbf93
commit
8c24592da2
@@ -2082,6 +2082,7 @@ do_ecmd (
|
|||||||
char_u *command = NULL;
|
char_u *command = NULL;
|
||||||
int did_get_winopts = FALSE;
|
int did_get_winopts = FALSE;
|
||||||
int readfile_flags = 0;
|
int readfile_flags = 0;
|
||||||
|
bool did_inc_redrawing_disabled = false;
|
||||||
|
|
||||||
if (eap != NULL)
|
if (eap != NULL)
|
||||||
command = eap->do_ecmd_cmd;
|
command = eap->do_ecmd_cmd;
|
||||||
@@ -2318,6 +2319,11 @@ do_ecmd (
|
|||||||
oldbuf = (flags & ECMD_OLDBUF);
|
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;
|
||||||
|
|
||||||
buf = curbuf;
|
buf = curbuf;
|
||||||
if ((flags & ECMD_SET_HELP) || keep_help_flag) {
|
if ((flags & ECMD_SET_HELP) || keep_help_flag) {
|
||||||
prepare_help_buffer();
|
prepare_help_buffer();
|
||||||
@@ -2394,8 +2400,6 @@ do_ecmd (
|
|||||||
/*
|
/*
|
||||||
* If we get here we are sure to start editing
|
* 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 */
|
/* Assume success now */
|
||||||
retval = OK;
|
retval = OK;
|
||||||
@@ -2547,7 +2551,8 @@ do_ecmd (
|
|||||||
if (curbuf->b_kmap_state & KEYMAP_INIT)
|
if (curbuf->b_kmap_state & KEYMAP_INIT)
|
||||||
(void)keymap_init();
|
(void)keymap_init();
|
||||||
|
|
||||||
--RedrawingDisabled;
|
RedrawingDisabled--;
|
||||||
|
did_inc_redrawing_disabled = false;
|
||||||
if (!skip_redraw) {
|
if (!skip_redraw) {
|
||||||
n = p_so;
|
n = p_so;
|
||||||
if (topline == 0 && command == NULL)
|
if (topline == 0 && command == NULL)
|
||||||
@@ -2566,8 +2571,12 @@ do_ecmd (
|
|||||||
|
|
||||||
|
|
||||||
theend:
|
theend:
|
||||||
if (did_set_swapcommand)
|
if (did_inc_redrawing_disabled) {
|
||||||
|
RedrawingDisabled--;
|
||||||
|
}
|
||||||
|
if (did_set_swapcommand) {
|
||||||
set_vim_var_string(VV_SWAPCOMMAND, NULL, -1);
|
set_vim_var_string(VV_SWAPCOMMAND, NULL, -1);
|
||||||
|
}
|
||||||
xfree(free_fname);
|
xfree(free_fname);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@@ -1177,7 +1177,7 @@ static int included_patches[] = {
|
|||||||
1269,
|
1269,
|
||||||
// 1268 NA
|
// 1268 NA
|
||||||
1267,
|
1267,
|
||||||
// 1266
|
1266,
|
||||||
// 1265 NA
|
// 1265 NA
|
||||||
// 1264 NA
|
// 1264 NA
|
||||||
// 1263 NA
|
// 1263 NA
|
||||||
|
Reference in New Issue
Block a user