1
0
forked from aniani/vim

patch 9.0.1072: screenpos() column result in fold may be too small

Problem:    screenpos() column result in fold may be too small.
Solution:   Add space of 'number', sign column, etc. (closes #11715)
This commit is contained in:
zeertzjq
2022-12-18 12:28:59 +00:00
committed by Bram Moolenaar
parent b5328b46a7
commit ba2d191932
3 changed files with 10 additions and 5 deletions

View File

@@ -150,8 +150,12 @@ func Test_screenpos_fold()
redraw
call assert_equal(2, screenpos(1, 2, 1).row)
call assert_equal(#{col: 1, row: 3, endcol: 1, curscol: 1}, screenpos(1, 3, 1))
call assert_equal(3, screenpos(1, 4, 1).row)
call assert_equal(3, screenpos(1, 5, 1).row)
call assert_equal(#{col: 1, row: 3, endcol: 1, curscol: 1}, screenpos(1, 4, 1))
call assert_equal(#{col: 1, row: 3, endcol: 1, curscol: 1}, screenpos(1, 5, 1))
setlocal number
call assert_equal(#{col: 5, row: 3, endcol: 5, curscol: 5}, screenpos(1, 3, 1))
call assert_equal(#{col: 5, row: 3, endcol: 5, curscol: 5}, screenpos(1, 4, 1))
call assert_equal(#{col: 5, row: 3, endcol: 5, curscol: 5}, screenpos(1, 5, 1))
call assert_equal(4, screenpos(1, 6, 1).row)
bwipe!
endfunc