diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-10-10 21:38:24 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-10-10 23:54:51 +0800 |
| commit | 249cb8345d6e2f9986ad1dfe42d9cde0f9ed7d6a (patch) | |
| tree | 1528d4e5fce4292d14653fc9103350a0a207511a /src/nvim/testdir | |
| parent | 5c9f6bdd8c0486ccc3fd1b6b408e7ced90bdbc5a (diff) | |
| download | rneovim-249cb8345d6e2f9986ad1dfe42d9cde0f9ed7d6a.tar.gz rneovim-249cb8345d6e2f9986ad1dfe42d9cde0f9ed7d6a.tar.bz2 rneovim-249cb8345d6e2f9986ad1dfe42d9cde0f9ed7d6a.zip | |
vim-patch:9.0.0712: wrong column when calling setcursorcharpos() with zero lnum
Problem: Wrong column when calling setcursorcharpos() with zero lnum.
Solution: Set the line number before calling buf_charidx_to_byteidx().
(closes vim/vim#11329)
https://github.com/vim/vim/commit/79f234499b6692cc16970b7455bc9b002242632f
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_cursor_func.vim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cursor_func.vim b/src/nvim/testdir/test_cursor_func.vim index e428bf3e23..9801a45915 100644 --- a/src/nvim/testdir/test_cursor_func.vim +++ b/src/nvim/testdir/test_cursor_func.vim @@ -353,8 +353,14 @@ func Test_setcursorcharpos() normal G call setcursorcharpos([1, 1]) call assert_equal([1, 1], [line('.'), col('.')]) + call setcursorcharpos([2, 7, 0]) call assert_equal([2, 9], [line('.'), col('.')]) + call setcursorcharpos([0, 7, 0]) + call assert_equal([2, 9], [line('.'), col('.')]) + call setcursorcharpos(0, 7, 0) + call assert_equal([2, 9], [line('.'), col('.')]) + call setcursorcharpos(3, 4) call assert_equal([3, 1], [line('.'), col('.')]) call setcursorcharpos([3, 1]) |