diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2024-06-21 14:35:24 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-21 14:35:24 +0800 |
| commit | a5d8e5336a0bc21c1841d45d47befb94ca2b54f4 (patch) | |
| tree | e489e3436ef4da30720292df277ca35dc64cffdd /test | |
| parent | 26c2a56d99f9435d6a32e42c9508cafc37ab7d72 (diff) | |
| parent | f45403db19d888266d1cc04756bfef20a26f9f7f (diff) | |
| download | rneovim-a5d8e5336a0bc21c1841d45d47befb94ca2b54f4.tar.gz rneovim-a5d8e5336a0bc21c1841d45d47befb94ca2b54f4.tar.bz2 rneovim-a5d8e5336a0bc21c1841d45d47befb94ca2b54f4.zip | |
Merge pull request #29436 from zeertzjq/vim-9.1.0507
vim-patch:9.1.{0507,0511}: CursorMovedC autocommand
Diffstat (limited to 'test')
| -rw-r--r-- | test/old/testdir/test_autocmd.vim | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/old/testdir/test_autocmd.vim b/test/old/testdir/test_autocmd.vim index cdcd68f3d6..3871cb5672 100644 --- a/test/old/testdir/test_autocmd.vim +++ b/test/old/testdir/test_autocmd.vim @@ -2010,6 +2010,29 @@ func Test_Cmdline() au! CmdlineEnter au! CmdlineLeave let &shellslash = save_shellslash + + au! CursorMovedC : let g:pos += [getcmdpos()] + let g:pos = [] + call feedkeys(":hello\<Left>\<C-R>=''\<CR>\<Left>\<Right>\<Esc>", 'xt') + call assert_equal([5, 4, 5], g:pos) + let g:pos = [] + call feedkeys(":12345678\<C-R>=setcmdpos(3)??''\<CR>\<Esc>", 'xt') + call assert_equal([3], g:pos) + let g:pos = [] + call feedkeys(":12345678\<C-R>=setcmdpos(3)??''\<CR>\<Left>\<Esc>", 'xt') + call assert_equal([3, 2], g:pos) + au! CursorMovedC + + " setcmdpos() is no-op inside an autocommand + au! CursorMovedC : let g:pos += [getcmdpos()] | call setcmdpos(1) + let g:pos = [] + call feedkeys(":hello\<Left>\<Left>\<Esc>", 'xt') + call assert_equal([5, 4], g:pos) + au! CursorMovedC + + unlet g:entered + unlet g:left + unlet g:pos endfunc " Test for BufWritePre autocommand that deletes or unloads the buffer. |