aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-06-05 09:19:09 +0800
committerGitHub <noreply@github.com>2023-06-05 09:19:09 +0800
commitcc41697775b0ea4a41a4f82a9e466123d4a2d77f (patch)
treebabfc7fab6873ff516a0c3fe1dbc4708a20f883f /test/old/testdir
parent5282d3299c9b1b07f3e02a9014bc2632cf3b4fed (diff)
parent7955c90621bb679f9c16b6788fbcb6145739886f (diff)
downloadrneovim-cc41697775b0ea4a41a4f82a9e466123d4a2d77f.tar.gz
rneovim-cc41697775b0ea4a41a4f82a9e466123d4a2d77f.tar.bz2
rneovim-cc41697775b0ea4a41a4f82a9e466123d4a2d77f.zip
Merge pull request #23908 from zeertzjq/vim-9.0.1600
vim-patch:9.0.{1600,1607}: screenpos() fixes
Diffstat (limited to 'test/old/testdir')
-rw-r--r--test/old/testdir/test_cursor_func.vim49
1 files changed, 48 insertions, 1 deletions
diff --git a/test/old/testdir/test_cursor_func.vim b/test/old/testdir/test_cursor_func.vim
index 239eff5db5..f73bd4f2b9 100644
--- a/test/old/testdir/test_cursor_func.vim
+++ b/test/old/testdir/test_cursor_func.vim
@@ -125,7 +125,41 @@ func Test_screenpos()
\ 'curscol': wincol + 7,
\ 'endcol': wincol + 7}, winid->screenpos(line('$'), 8))
call assert_equal({'row': 0, 'col': 0, 'curscol': 0, 'endcol': 0},
- \ winid->screenpos(line('$'), 22))
+ \ winid->screenpos(line('$'), 22))
+
+ 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_leftcol should be subtracted
+ setlocal nowrap
+ normal 050zl$
+ call assert_equal({'row': winrow + 0,
+ \ 'col': wincol + 10 - 1,
+ \ 'curscol': wincol + 10 - 1,
+ \ 'endcol': wincol + 10 - 1},
+ \ screenpos(win_getid(), line('.'), col('.')))
+
+ " w_skipcol should only matter for the topline
+" FIXME: This fails because pline_m_win() does not take w_skipcol into
+" account. If it does, then other tests fail.
+" wincmd +
+" setlocal wrap smoothscroll
+" call setline(line('$') + 1, 'last line')
+" exe "normal \<C-E>G$"
+" redraw
+" call assert_equal({'row': winrow + 1,
+" \ 'col': wincol + 9 - 1,
+" \ 'curscol': wincol + 9 - 1,
+" \ 'endcol': wincol + 9 - 1},
+" \ screenpos(win_getid(), line('.'), col('.')))
+ close
close
call assert_equal({}, screenpos(999, 1, 1))
@@ -170,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!