comparison src/testdir/test_cursor_func.vim @ 33920:28e1e956f42c v9.0.2159

patch 9.0.2159: screenpos() may crash with neg. column Commit: https://github.com/vim/vim/commit/ec54af4e26952d954a4cc009f62c80ea01445d30 Author: zeertzjq <zeertzjq@outlook.com> Date: Tue Dec 12 16:43:44 2023 +0100 patch 9.0.2159: screenpos() may crash with neg. column Problem: screenpos() may crash with neg. column Solution: validate and correct column closes: #13669 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 12 Dec 2023 17:00:08 +0100
parents bfe07ef45143
children
comparison
equal deleted inserted replaced
33919:7512223bb93c 33920:28e1e956f42c
204 204
205 call assert_equal(#{col: 1, row: 1, endcol: 1, curscol: 1}, screenpos(win_getid(), 1, 1)) 205 call assert_equal(#{col: 1, row: 1, endcol: 1, curscol: 1}, screenpos(win_getid(), 1, 1))
206 nmenu WinBar.TEST : 206 nmenu WinBar.TEST :
207 call assert_equal(#{col: 1, row: 2, endcol: 1, curscol: 1}, screenpos(win_getid(), 1, 1)) 207 call assert_equal(#{col: 1, row: 2, endcol: 1, curscol: 1}, screenpos(win_getid(), 1, 1))
208 nunmenu WinBar.TEST 208 nunmenu WinBar.TEST
209 call assert_equal(#{col: 1, row: 1, endcol: 1, curscol: 1}, screenpos(win_getid(), 1, 1))
210
211 call assert_equal(#{col: 0, row: 0, endcol: 0, curscol: 0}, screenpos(0, 0, 1))
212 call assert_equal(#{col: 0, row: 0, endcol: 0, curscol: 0}, screenpos(0, -1, 1))
213 call assert_equal(#{col: 1, row: 1, endcol: 1, curscol: 1}, screenpos(0, 1, -v:maxcol))
209 endfunc 214 endfunc
210 215
211 func Test_screenpos_fold() 216 func Test_screenpos_fold()
212 CheckFeature folding 217 CheckFeature folding
213 218