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 #10761)
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index e9a59c2..1202c05 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -2301,6 +2301,25 @@
call assert_fails('au WinNew * nested nested echo bad', 'E983:')
endfunc
+func Test_autocmd_nested_cursor_invalid()
+ set laststatus=0
+ copen
+ cclose
+ call setline(1, ['foo', 'bar', 'baz'])
+ 3
+ augroup nested_inv
+ autocmd User foo ++nested copen
+ autocmd BufAdd * let &laststatus = 2 - &laststatus
+ augroup END
+ doautocmd User foo
+
+ augroup nested_inv
+ au!
+ augroup END
+ set laststatus&
+ bwipe!
+endfunc
+
func Test_autocmd_once()
" Without ++once WinNew triggers twice
let g:did_split = 0