aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-06-05 06:33:43 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-06-05 07:49:44 +0800
commit49ede0a68f1f8fd46dc9715fb1f332a13d13dbe3 (patch)
tree788a34af81a3535586a21682c2cd1dfc9705de95 /test
parent5282d3299c9b1b07f3e02a9014bc2632cf3b4fed (diff)
downloadrneovim-49ede0a68f1f8fd46dc9715fb1f332a13d13dbe3.tar.gz
rneovim-49ede0a68f1f8fd46dc9715fb1f332a13d13dbe3.tar.bz2
rneovim-49ede0a68f1f8fd46dc9715fb1f332a13d13dbe3.zip
vim-patch:9.0.1600: screenpos() does not take w_skipcol into account
Problem: screenpos() does not take w_skipcol into account. Solution: Subtract w_skipcol from column. (closes vim/vim#12486, closes vim/vim#12476) https://github.com/vim/vim/commit/f0e68c0e2a3539f899e737e5b167622fe081fbbd
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_cursor_func.vim35
1 files changed, 34 insertions, 1 deletions
diff --git a/test/old/testdir/test_cursor_func.vim b/test/old/testdir/test_cursor_func.vim
index 239eff5db5..7c8b691f66 100644
--- a/test/old/testdir/test_cursor_func.vim
+++ b/test/old/testdir/test_cursor_func.vim
@@ -125,7 +125,40 @@ 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
+ 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
+ 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))