aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-07-08 06:55:21 +0800
committerGitHub <noreply@github.com>2024-07-08 06:55:21 +0800
commit76b91106fc836ae634cdf8425d121d843d14d70a (patch)
tree7f7583c4f7e0f2048650c3e2e5b9346922d0d2a4 /test
parent055a222797e46a046a365707e4e0dc957e46c648 (diff)
downloadrneovim-76b91106fc836ae634cdf8425d121d843d14d70a.tar.gz
rneovim-76b91106fc836ae634cdf8425d121d843d14d70a.tar.bz2
rneovim-76b91106fc836ae634cdf8425d121d843d14d70a.zip
vim-patch:9.1.0543: Behavior of CursorMovedC is strange (#29608)
Problem: Behavior of CursorMovedC is strange. Solution: Also trigger when the cmdline has changed. (zeertzjq) fixes: vim/vim#15069 closes: vim/vim#15071 https://github.com/vim/vim/commit/8145620a958dbb5c82cf8f8a37556ee1ea501c6d
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_autocmd.vim17
1 files changed, 13 insertions, 4 deletions
diff --git a/test/old/testdir/test_autocmd.vim b/test/old/testdir/test_autocmd.vim
index 3871cb5672..862c48a1eb 100644
--- a/test/old/testdir/test_autocmd.vim
+++ b/test/old/testdir/test_autocmd.vim
@@ -2013,21 +2013,30 @@ func Test_Cmdline()
au! CursorMovedC : let g:pos += [getcmdpos()]
let g:pos = []
+ call feedkeys(":foo bar baz\<C-W>\<C-W>\<C-W>\<Esc>", 'xt')
+ call assert_equal([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 9, 5, 1], g:pos)
+ let g:pos = []
+ call feedkeys(":hello\<C-B>\<Esc>", 'xt')
+ call assert_equal([2, 3, 4, 5, 6, 1], g:pos)
+ let g:pos = []
+ call feedkeys(":hello\<C-U>\<Esc>", 'xt')
+ call assert_equal([2, 3, 4, 5, 6, 1], g:pos)
+ let g:pos = []
call feedkeys(":hello\<Left>\<C-R>=''\<CR>\<Left>\<Right>\<Esc>", 'xt')
- call assert_equal([5, 4, 5], g:pos)
+ call assert_equal([2, 3, 4, 5, 6, 5, 4, 5], g:pos)
let g:pos = []
call feedkeys(":12345678\<C-R>=setcmdpos(3)??''\<CR>\<Esc>", 'xt')
- call assert_equal([3], g:pos)
+ call assert_equal([2, 3, 4, 5, 6, 7, 8, 9, 3], g:pos)
let g:pos = []
call feedkeys(":12345678\<C-R>=setcmdpos(3)??''\<CR>\<Left>\<Esc>", 'xt')
- call assert_equal([3, 2], g:pos)
+ call assert_equal([2, 3, 4, 5, 6, 7, 8, 9, 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)
+ call assert_equal([2, 3, 4, 5, 6, 5, 4], g:pos)
au! CursorMovedC
unlet g:entered