aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-09-18 20:34:18 -0500
committerGitHub <noreply@github.com>2016-09-18 20:34:18 -0500
commitefe8311371830930b2ab14937b8d6adc801cc99b (patch)
tree9ed7be637ea71baf3d934c4bfd851f5be5170805
parent4a6b4bbf931bee14717ae1c30331e85758a3080e (diff)
parent8c24592da216ea97feb33d171c3f0dbca51e0aab (diff)
downloadrneovim-efe8311371830930b2ab14937b8d6adc801cc99b.tar.gz
rneovim-efe8311371830930b2ab14937b8d6adc801cc99b.tar.bz2
rneovim-efe8311371830930b2ab14937b8d6adc801cc99b.zip
Merge pull request #4739 from brcolow/vim-7.4.1266
vim-patch 7.4.1266
-rw-r--r--src/nvim/ex_cmds.c17
-rw-r--r--src/nvim/version.c2
2 files changed, 14 insertions, 5 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 9cf53f0d73..c36c3a7b0e 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -2082,6 +2082,7 @@ do_ecmd (
char_u *command = NULL;
int did_get_winopts = FALSE;
int readfile_flags = 0;
+ bool did_inc_redrawing_disabled = false;
if (eap != NULL)
command = eap->do_ecmd_cmd;
@@ -2318,6 +2319,11 @@ do_ecmd (
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;
if ((flags & ECMD_SET_HELP) || keep_help_flag) {
prepare_help_buffer();
@@ -2394,8 +2400,6 @@ do_ecmd (
/*
* 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;
@@ -2547,7 +2551,8 @@ do_ecmd (
if (curbuf->b_kmap_state & KEYMAP_INIT)
(void)keymap_init();
- --RedrawingDisabled;
+ RedrawingDisabled--;
+ did_inc_redrawing_disabled = false;
if (!skip_redraw) {
n = p_so;
if (topline == 0 && command == NULL)
@@ -2566,8 +2571,12 @@ do_ecmd (
theend:
- if (did_set_swapcommand)
+ if (did_inc_redrawing_disabled) {
+ RedrawingDisabled--;
+ }
+ if (did_set_swapcommand) {
set_vim_var_string(VV_SWAPCOMMAND, NULL, -1);
+ }
xfree(free_fname);
return retval;
}
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 439deab139..63acd22514 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -1177,7 +1177,7 @@ static int included_patches[] = {
1269,
// 1268 NA
1267,
- // 1266
+ 1266,
// 1265 NA
// 1264 NA
// 1263 NA