diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-04-11 21:29:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-11 21:29:18 +0800 |
commit | 356cff78ece597059133e33eceb955f72286a319 (patch) | |
tree | 821af4b01506ae26d16a3e272adab4ea1c8d5fa2 /src/nvim/testdir | |
parent | f0d07dcb7499412f42654690183606d2551b6d66 (diff) | |
download | rneovim-356cff78ece597059133e33eceb955f72286a319.tar.gz rneovim-356cff78ece597059133e33eceb955f72286a319.tar.bz2 rneovim-356cff78ece597059133e33eceb955f72286a319.zip |
vim-patch:8.2.4734: getcharpos() may change a mark position (#18077)
Problem: getcharpos() may change a mark position.
Solution: Copy the mark position. (closes vim/vim#10148)
https://github.com/vim/vim/commit/3caf1cce2b85a8f24195d057f0ad63082543e99e
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_cursor_func.vim | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_cursor_func.vim b/src/nvim/testdir/test_cursor_func.vim index 57825b4551..9ba82e3b70 100644 --- a/src/nvim/testdir/test_cursor_func.vim +++ b/src/nvim/testdir/test_cursor_func.vim @@ -140,12 +140,12 @@ func Test_getcharpos() call assert_fails('call getcharpos({})', 'E731:') call assert_equal([0, 0, 0, 0], getcharpos(0)) new - call setline(1, ['', "01\tà4è678", 'Ⅵ', '012345678']) + call setline(1, ['', "01\tà4è678", 'Ⅵ', '012345678', ' │ x']) " Test for '.' and '$' normal 1G call assert_equal([0, 1, 1, 0], getcharpos('.')) - call assert_equal([0, 4, 1, 0], getcharpos('$')) + call assert_equal([0, 5, 1, 0], getcharpos('$')) normal 2G6l call assert_equal([0, 2, 7, 0], getcharpos('.')) normal 3G$ @@ -159,6 +159,12 @@ func Test_getcharpos() delmarks m call assert_equal([0, 0, 0, 0], getcharpos("'m")) + " Check mark does not move + normal 5Gfxma + call assert_equal([0, 5, 5, 0], getcharpos("'a")) + call assert_equal([0, 5, 5, 0], getcharpos("'a")) + call assert_equal([0, 5, 5, 0], getcharpos("'a")) + " Test for the visual start column vnoremap <expr> <F3> SaveVisualStartCharPos() let g:VisualStartPos = [] |