diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-06-05 06:40:39 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-06-05 07:49:44 +0800 |
commit | 57fef392d265e2ef40c8c514749d658cb4d8d22a (patch) | |
tree | 0250f0d0652720668a6a702e85379e97bd1c9ded /test | |
parent | 49ede0a68f1f8fd46dc9715fb1f332a13d13dbe3 (diff) | |
download | rneovim-57fef392d265e2ef40c8c514749d658cb4d8d22a.tar.gz rneovim-57fef392d265e2ef40c8c514749d658cb4d8d22a.tar.bz2 rneovim-57fef392d265e2ef40c8c514749d658cb4d8d22a.zip |
vim-patch:9.0.1607: screenpos() returns wrong row with diff filler lines
Problem: screenpos() returns wrong row with diff filler lines.
Solution: Only add filler lines when appropriate. Also don't add the
'smoothscroll' marker when w_skipcol is zero. (closes vim/vim#12485,
closes vim/vim#12484)
https://github.com/vim/vim/commit/55daae392157823dc5434e6be1344f4336bfe96f
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_cursor_func.vim | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/old/testdir/test_cursor_func.vim b/test/old/testdir/test_cursor_func.vim index 7c8b691f66..f73bd4f2b9 100644 --- a/test/old/testdir/test_cursor_func.vim +++ b/test/old/testdir/test_cursor_func.vim @@ -130,13 +130,14 @@ func Test_screenpos() 1split normal G$ redraw + " w_skipcol should be subtracted call assert_equal({'row': winrow + 0, \ 'col': wincol + 20 - 1, \ 'curscol': wincol + 20 - 1, \ 'endcol': wincol + 20 - 1}, \ screenpos(win_getid(), line('.'), col('.'))) - " w_skipcol should be subtracted + " w_leftcol should be subtracted setlocal nowrap normal 050zl$ call assert_equal({'row': winrow + 0, @@ -203,6 +204,19 @@ func Test_screenpos_diff() windo diffthis wincmd w call assert_equal(#{col: 3, row: 7, endcol: 3, curscol: 3}, screenpos(0, 4, 1)) + call assert_equal(#{col: 3, row: 8, endcol: 3, curscol: 3}, screenpos(0, 5, 1)) + exe "normal! 3\<C-E>" + call assert_equal(#{col: 3, row: 4, endcol: 3, curscol: 3}, screenpos(0, 4, 1)) + call assert_equal(#{col: 3, row: 5, endcol: 3, curscol: 3}, screenpos(0, 5, 1)) + exe "normal! \<C-E>" + call assert_equal(#{col: 3, row: 3, endcol: 3, curscol: 3}, screenpos(0, 4, 1)) + call assert_equal(#{col: 3, row: 4, endcol: 3, curscol: 3}, screenpos(0, 5, 1)) + exe "normal! \<C-E>" + call assert_equal(#{col: 3, row: 2, endcol: 3, curscol: 3}, screenpos(0, 4, 1)) + call assert_equal(#{col: 3, row: 3, endcol: 3, curscol: 3}, screenpos(0, 5, 1)) + exe "normal! \<C-E>" + call assert_equal(#{col: 3, row: 1, endcol: 3, curscol: 3}, screenpos(0, 4, 1)) + call assert_equal(#{col: 3, row: 2, endcol: 3, curscol: 3}, screenpos(0, 5, 1)) windo diffoff bwipe! |