summaryrefslogtreecommitdiffstats
path: root/src/autocmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-07-23 09:06:48 +0100
committerBram Moolenaar <Bram@vim.org>2022-07-23 09:06:48 +0100
commit5fa9f23a63651a8abdb074b4fc2ec9b1adc6b089 (patch)
treeecfbc53cfa7bd322b2506a4b11909e234063272d /src/autocmd.c
parentb9e717367c395490149495cf375911b5d9de889e (diff)
patch 9.0.0061: ml_get error with nested autocommandv9.0.0061
Problem: ml_get error with nested autocommand. Solution: Also check line numbers for a nested autocommand. (closes #10761)
Diffstat (limited to 'src/autocmd.c')
-rw-r--r--src/autocmd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/autocmd.c b/src/autocmd.c
index 841da14622..c376f20a23 100644
--- a/src/autocmd.c
+++ b/src/autocmd.c
@@ -2209,9 +2209,13 @@ apply_autocmds_group(
ap->last = FALSE;
ap->last = TRUE;
+ // Make sure cursor and topline are valid. The first time the current
+ // values are saved, restored by reset_lnums(). When nested only the
+ // values are corrected when needed.
if (nesting == 1)
- // make sure cursor and topline are valid
check_lnums(TRUE);
+ else
+ check_lnums_nested(TRUE);
save_did_emsg = did_emsg;