diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-07-28 11:27:58 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-07-28 11:40:35 +0800 |
| commit | 0134a2cb3eaf03cbf845a5f9c13a153e4ef9b6b6 (patch) | |
| tree | e5d2abb911d65b1eb2761e4cb5c2109867ebbcbf /src/nvim/testdir | |
| parent | 394d65494aead6ee07298e19d53c99603b11471d (diff) | |
| download | rneovim-0134a2cb3eaf03cbf845a5f9c13a153e4ef9b6b6.tar.gz rneovim-0134a2cb3eaf03cbf845a5f9c13a153e4ef9b6b6.tar.bz2 rneovim-0134a2cb3eaf03cbf845a5f9c13a153e4ef9b6b6.zip | |
vim-patch:9.0.0094: cursor restored unexpected with nested autocommand
Problem: Cursor restored unexpected with nested autocommand.
Solution: Do not restore the cursor when it was moved intentionally.
(closes vim/vim#10780)
https://github.com/vim/vim/commit/3d6ee8bda0550a01346f5992bbce09c0eb6d7569
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_autocmd.vim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim index 7645a27fdf..1c2f86a584 100644 --- a/src/nvim/testdir/test_autocmd.vim +++ b/src/nvim/testdir/test_autocmd.vim @@ -2190,6 +2190,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 |