diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-12-13 06:17:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-13 06:17:50 +0800 |
commit | d65c6a0bafada059e87a11a4bcd129afc16d2e5d (patch) | |
tree | b7b61f1bab5645e344a37daae36fafe198ebc92e /test | |
parent | 69ffbb76c237fcbba24de80f1b5346d92642e800 (diff) | |
download | rneovim-d65c6a0bafada059e87a11a4bcd129afc16d2e5d.tar.gz rneovim-d65c6a0bafada059e87a11a4bcd129afc16d2e5d.tar.bz2 rneovim-d65c6a0bafada059e87a11a4bcd129afc16d2e5d.zip |
vim-patch:9.0.2159: screenpos() may crash with neg. column (#26542)
Problem: screenpos() may crash with neg. column
Solution: validate and correct column
closes: vim/vim#13669
https://github.com/vim/vim/commit/ec54af4e26952d954a4cc009f62c80ea01445d30
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_cursor_func.vim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/old/testdir/test_cursor_func.vim b/test/old/testdir/test_cursor_func.vim index cf131e8dad..5d99963814 100644 --- a/test/old/testdir/test_cursor_func.vim +++ b/test/old/testdir/test_cursor_func.vim @@ -206,6 +206,11 @@ func Test_screenpos() call assert_equal(#{col: 1, row: 2, endcol: 1, curscol: 1}, screenpos(win_getid(), 1, 1)) " nunmenu WinBar.TEST setlocal winbar& + call assert_equal(#{col: 1, row: 1, endcol: 1, curscol: 1}, screenpos(win_getid(), 1, 1)) + + call assert_equal(#{col: 0, row: 0, endcol: 0, curscol: 0}, screenpos(0, 0, 1)) + call assert_equal(#{col: 0, row: 0, endcol: 0, curscol: 0}, screenpos(0, -1, 1)) + call assert_equal(#{col: 1, row: 1, endcol: 1, curscol: 1}, screenpos(0, 1, -v:maxcol)) endfunc func Test_screenpos_fold() |