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 #12485,
closes #12484)
diff --git a/src/testdir/test_cursor_func.vim b/src/testdir/test_cursor_func.vim
index c37826c..74d7581 100644
--- a/src/testdir/test_cursor_func.vim
+++ b/src/testdir/test_cursor_func.vim
@@ -132,13 +132,14 @@
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 @@
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!