comparison src/testdir/test_cursor_func.vim @ 18469:66964658cc3c v8.1.2228

patch 8.1.2228: screenpos() returns wrong values when 'number' is set Commit: https://github.com/vim/vim/commit/38ba4dce4a8574e60f6ddb111922880b0c7affdc Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 27 21:39:09 2019 +0100 patch 8.1.2228: screenpos() returns wrong values when 'number' is set Problem: screenpos() returns wrong values when 'number' is set. (Ben Jackson) Solution: Compare the column with the window width. (closes #5133)
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Oct 2019 21:45:03 +0100
parents 11dca9732a48
children e82996ad131f
comparison
equal deleted inserted replaced
18468:5f2d45da8870 18469:66964658cc3c
98 \ 'curscol': wincol + 9, 98 \ 'curscol': wincol + 9,
99 \ 'endcol': wincol + 9}, screenpos(winid, 2, 22)) 99 \ 'endcol': wincol + 9}, screenpos(winid, 2, 22))
100 close 100 close
101 bwipe! 101 bwipe!
102 endfunc 102 endfunc
103
104 func Test_screenpos_number()
105 rightbelow new
106 rightbelow 73vsplit
107 call setline (1, repeat('x', 66))
108 setlocal number
109 redraw
110 let winid = win_getid()
111 let [winrow, wincol] = win_screenpos(winid)
112 let pos = screenpos(winid, 1, 66)
113 call assert_equal(winrow, pos.row)
114 call assert_equal(wincol + 66 + 3, pos.col)
115 close
116 bwipe!
117 endfunc