diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-07-27 15:23:35 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-07-27 15:23:35 +0100 |
commit | 3d6ee8bda0550a01346f5992bbce09c0eb6d7569 (patch) | |
tree | 1bc029d00d152ae32522ed705cc5da8cd6c190d4 /src/testdir/test_autocmd.vim | |
parent | 7abd1c6d8e777bde1700633bafc1a40be9e9c1aa (diff) | |
download | vim-git-3d6ee8bda0550a01346f5992bbce09c0eb6d7569.tar.gz |
patch 9.0.0094: cursor restored unexpected with nested autocommandv9.0.0094
Problem: Cursor restored unexpected with nested autocommand.
Solution: Do not restore the cursor when it was moved intentionally.
(closes #10780)
Diffstat (limited to 'src/testdir/test_autocmd.vim')
-rw-r--r-- | src/testdir/test_autocmd.vim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index f7763e6bd..6bbe48c0f 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -2321,6 +2321,17 @@ func Test_autocmd_nested_cursor_invalid() bwipe! endfunc +func Test_autocmd_nested_keeps_cursor_pos() + enew + call setline(1, 'foo') + autocmd User foo ++nested normal! $a + autocmd InsertLeave * : + doautocmd User foo + call assert_equal([0, 1, 3, 0], getpos('.')) + + bwipe! +endfunc + func Test_autocmd_nested_switch_window() " run this in a separate Vim so that SafeState works CheckRunVimInTerminal |