diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-23 17:45:45 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-07-28 11:38:02 +0800 |
commit | 8e67af1b201adfca9f6c3589b4f7c59b323e9459 (patch) | |
tree | 9828c1be0315061f2522d5991258c266f6bbc01d /src/nvim/autocmd.c | |
parent | bdbf843031b91db7ab0d4ad925c8652947d38b70 (diff) | |
download | rneovim-8e67af1b201adfca9f6c3589b4f7c59b323e9459.tar.gz rneovim-8e67af1b201adfca9f6c3589b4f7c59b323e9459.tar.bz2 rneovim-8e67af1b201adfca9f6c3589b4f7c59b323e9459.zip |
vim-patch:9.0.0061: ml_get error with nested autocommand
Problem: ml_get error with nested autocommand.
Solution: Also check line numbers for a nested autocommand. (closes vim/vim#10761)
https://github.com/vim/vim/commit/5fa9f23a63651a8abdb074b4fc2ec9b1adc6b089
Diffstat (limited to 'src/nvim/autocmd.c')
-rw-r--r-- | src/nvim/autocmd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index 73c2cda92b..2b4c9c5b9c 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -1837,9 +1837,13 @@ bool apply_autocmds_group(event_T event, char *fname, char *fname_io, bool force } 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); } // Execute the autocmd. The `getnextac` callback handles iteration. |